#3765: Exception when adding a new record in the admin form with related
recordss
----------------------------------+-----------------------------------------
Reporter: [EMAIL PROTECTED] | Owner: adrian
Status: new | Component: Admin interface
Version: SVN | Resolution:
Keywords: | Stage: Unreviewed
Has_patch: 1 | Needs_docs: 0
Needs_tests: 1 | Needs_better_patch: 1
----------------------------------+-----------------------------------------
Comment (by [EMAIL PROTECTED]):
I found why new_data.get(self.name, self.get_default()) didn't return
list. Issue is in MultiValueDict: in python 2.5:
>>>d = MultiValueDict(a=[1,2,3])
>>>dict(d)
{'a': 3}
But in python 2.4 result is:
>>>d = MultiValueDict(a=[1,2,3])
>>>dict(d)
{'a': [1,2,3]}
With debbuger i found that in python 2.5 dict(d) executes method
d.__getitem__ to gather value of d['a'], in python 2.4 that method isn't
executed.
I think thad decorate dict.__init__ is the best solution, but i don't know
how to decorate methods of builtin types.
In my solution that works i add method todict to MultiValueDict.
--
Ticket URL: <http://code.djangoproject.com/ticket/3765#comment:6>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" 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-updates?hl=en
-~----------~----~----~----~------~----~------~--~---