Commits

xavi...@ptit-mec.local  committed f2eeaa7

querysets can use fields

  • Participants
  • Parent commits c1dd2f6

Comments (0)

Files changed (1)

File piston/emitters.py

             """
             ret = None
             
-            if isinstance(thing, (tuple, list, QuerySet)):
+            if isinstance(thing, QuerySet):
+                ret = _qs(thing, fields=fields)
+            elif isinstance(thing, (tuple, list, QuerySet)):
                 ret = _list(thing)
             elif isinstance(thing, dict):
                 ret = _dict(thing)
                 except: pass
             
             return ret
-        
+        def _qs(data, fields=()):
+            """
+            Lists.
+            """
+            return [ _any(v, fields) for v in data ]
+                
         def _list(data):
             """
             Lists.