Commits

Chris Hasenpflug committed 818e9df

Move `dictfetchall()` to utils module.

  • Participants
  • Parent commits f268673

Comments (0)

Files changed (2)

File xenforo/middleware.py

 import phpserialize
 
 from .conf import settings
-
-
-def dictfetchall(cursor):
-    "Returns all rows from a cursor as a dict"
-    desc = cursor.description
-    return [
-        dict(zip([col[0] for col in desc], row))
-        for row in cursor.fetchall()
-    ]
+from .utils import dictfetchall
 
 
 class XFSessionMiddleware(object):

File xenforo/utils.py

+
+def dictfetchall(cursor):
+    "Returns all rows from a cursor as a dict"
+    desc = cursor.description
+    return [
+        dict(zip([col[0] for col in desc], row))
+        for row in cursor.fetchall()
+    ]