Hi James,

Ok will do!



On Sunday, September 8, 2013 9:23:48 PM UTC+2, Pepsodent Cola wrote:
>
> I don't understand how to fix this error message?  Here is the code that 
> made things break.
>
> Exception Value: global name 'dictfetchall2' is not defined
>
>
>
>
> #_______________________________________________________________________________
>
> 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()
>     ]
>
> #_______________________________________________________________________________
>
> class AltwordManager(models.Manager):
> *    def dictfetchall2(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()
>         ]
>
>     def vote_order(self):
>         "Returns a 1:M list ordered by votes."
>         cursor =  connection.cursor()
>         cursor.execute("""
> SELECT navi_polls_word.rosword
> FROM navi_polls_altword
>         """)
>         #row = cursor.fetchall()
>         #row = dictfetchall(cursor)
> *        row = dictfetchall2(cursor)*
>         return row
>
> ...
> ...
>
> #_______________________________________________________________________________
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to