#5505: Self-Referential ForeignKeys broken using newforms form_for_instance
with a
formfield_callback
-------------------------+--------------------------------------------------
Reporter: danlarkin | Owner: nobody
Status: new | Component: django.newforms
Version: SVN | Resolution:
Keywords: | Stage: Unreviewed
Has_patch: 1 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 0
-------------------------+--------------------------------------------------
Comment (by mtredinnick):
I'm travelling for work, so might not be able to get to this for a couple
of days, so here are some notes from a quick read of the patches when
danlarkin pointed me at them:
* View the `__deepcopy__` implementation with some suspicion. If there's
anything in the Field class that is a complex structure, such as a list or
a dictionary, we need to make copies of those attributes directly, since
copy.copy() only makes a new reference to them, not a new copy.
* My initial reaction was to wonder if we needed `__deepcopy__` on the
Field class or possibly just on something like
django.db.models.field.related.Relation. It's worth spending a few minutes
trying to put it in the right place in order to be clear. Basic rule is
that if a class if going to have dynamic methods created by its own
`__init__` or other methods, it's a fair chance it will need a manual
`__deepcopy__` written.
--
Ticket URL: <http://code.djangoproject.com/ticket/5505#comment:4>
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
-~----------~----~----~----~------~----~------~--~---