#5505: Self-Referential ForeignKeys broken using newforms form_for_instance
with a
formfield_callback
-----------------------------+----------------------------------------------
Reporter: danlarkin | Owner: mtredinnick
Status: new | Component: django.newforms
Version: SVN | Resolution:
Keywords: deepcopy copy | Stage: Unreviewed
Has_patch: 1 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 0
-----------------------------+----------------------------------------------
Changes (by mtredinnick):
* owner: nobody => mtredinnick
Comment:
I need to test some things on an earlier Python version (2.5 is a bit too
robust and makes replicating the problem difficult), but here are a few
notes:
1. The test case is a bit broken. The formfield_callback doesn't return
the right thing (a form field), so that is triggering some other problems.
It should be something similar to the default in newforms/models.py,
otherwise we are testing something that isn't intended to work.
2. newforms-forms.patch is only needed because of the problem in the
previous comment. Fixing the callback in the test to return the right sort
of thing removes the issue. All form fields should have a widget attached,
so that patch is fixing the wrong place; fortunately, we can omit it.
3. Joseph Kocherhan's feelings are pretty much correct about how
`Widget.__deepcopy__` should behave. I have a patch that mostly fixes that
which I need to test against an earlier Python version that I have to
build on my laptop.
With reference to the previous comment, we're not going to put in
alternate behaviour for Python 2.4 and 2.5. That would make the results
inconsistent (dependent on the Python version). We should always have the
same behaviour, regardless of Python version. That's what compatibility is
all about.
--
Ticket URL: <http://code.djangoproject.com/ticket/5505#comment:18>
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
-~----------~----~----~----~------~----~------~--~---