Commits

Anonymous committed f2eeaa7

querysets can use fields

Comments (0)

Files changed (1)

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.