Commits

hideki nara  committed e2c961e

queryset can be specified.

  • Participants
  • Parent commits 4e0ce79

Comments (0)

Files changed (1)

File csvutils/models.py

             rec,e = self.from_dictrow(row,keys)
             yield index,rec,e 
 
-    def csv_dump(self,fields=None, exclude=[], display=True, *args, **kwargs):
+    def csv_dump(self,queryset=None,fields=None, exclude=[], display=True, *args, **kwargs):
         ''' 
         .. todo::
 
 
         yield -1, header            #: -1 = hederline
     
+        queryset = queryset if queryset else self.filter
         # body 
         count=0
-        for obj in self.filter():
+        for obj in queryset:
             row = []
             for field_name in data_fields:
                 try: