This is more of a python question but its in my Django project. I am
reading a unicode object and an integer from a database into a
dictionnary and storing that in a pickled file. Ive confirmed the
dictionary is done correctly because i print it out from the pickled
file later to check. I also cast the unicode object as a string
before making it the key corresponding to an integer in the
dictionary. This also appears to work. However, when I try to use an
if statement to check if a key is in the dictionary I get this error:
"sequence item 0: expected string, int found". Ive tried not casting
the dictionary keys as strings and I get the same error. I dont
understand because when I print the dictionary after reading it from
the pickled file it is in string form. I should also say that these
unicode objects Im reading in are always integer numbers. So when i
read in from the database my end result it something like: {'200': 1,
'300': 4, etc...}. WHat is going wrong here?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.