I have problem, with strange behavior of django shell. I have this code:
fields = ('name', 'description', 'long_description', 'foot_description')
a = 1
dict( (field, a) for field in fields)
When I run it from python shell it's give me right dict. But when i running it from django shell i get:
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
/usr/local/lib/python2.7/dist-packages/django/core/management/commands/shell.pyc in <module>()
----> 1 dict( (field, a) for field in fields)
/usr/local/lib/python2.7/dist-packages/django/core/management/commands/shell.pyc in <genexpr>((field,))
----> 1 dict( (field, a) for field in fields)
NameError: global name 'a' is not defined
My question is simple: WHY?