#2536: Mutually referential many-to-one relationship AddManipulator fails.
------------------------------+---------------------------------------------
Reporter: anonymous | Owner: adrian
Type: defect | Status: new
Priority: normal | Milestone:
Component: Database wrapper | Version:
Severity: normal | Resolution:
Keywords: |
------------------------------+---------------------------------------------
Comment (by [EMAIL PROTECTED]):
I played with this some more this evening (I'd really like the admin
interface to work for my mutually referential models!) If I make the
child look like this:
{{{
#! python
class Child(Model):
name = CharField(maxlength=100)
myparent = ForeignKey(Parent)
}}}
Then Child.AddManipulator() now works. The admin app seems to work
wonderfully now too. Though I wonder, there's gotta be some downside to
this workaround, right?
I decided to do a little more playing around. If I make the classes look
like this:
{{{
#! python
from django.db.models import *
class Parent(Model):
name = CharField(maxlength=100, core=True)
child = ForeignKey("Child", null=True, related_name="favoured_by")
class Child(Model):
name = CharField(maxlength=100)
parent = ForeignKey(Parent, related_name="kiddo")
}}}
Then AddManipulator() fails for both models with the same complaint:
{{{'bool' object has no attribute 'get'}}}. So, even though the general
recommendation is to name ForeignKey attributes after the classes they
references, if you do that in this case, you get errors.
--
Ticket URL: <http://code.djangoproject.com/ticket/2536>
Django <http://code.djangoproject.org/>
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
-~----------~----~----~----~------~----~------~--~---