This is an issue I'm sure many must have encountered before but I
haven't found a solution. Given these models...
class Address(models.Model):
street = models.CharField(maxlength=150)
zip = models.CharField(maxlength=10)
city = models.CharField(maxlength=100)
class Person(models.Model):
address = models.ForeignKey(Address)
firstname = models.CharField(maxlength=100)
lastname = models.CharField(maxlength=100)
class Company(models.Model):
address = models.ForeignKey(Address)
name = models.CharField(maxlength=100)
... is it possible to edit Persons and Companies in the admin and have
their addresses edited inline? By setting edit_inline=True for the
ForeignKey fields I can edit Persons and Companies inline when editing
addresses but in this case I would like to do the reverse, is that
possible?
I could add two foreignkey fields to Address referencing Person and
Company respectively and allow both to be null. Or I could just remove
the Address class and move all address fields into both Person and
Company instead. But both these solutions are IMO uglier.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---