My admin looks something like the following-
class TitleInline(admin.TabularInline):
model = Title
extra = 1
class WorkAdmin(admin.ModelAdmin):
inlines = [TitleInline]
admin.site.register(Work, WorkAdmin)
My models look something like this-
class Work(ArtBaseModel):
def __unicode__(self):
return "Foobar"
class Title(ArtBaseModel):
"""
Title record.
"""
work = models.ForeignKey(Work, related_name="title_set")
displayString = models.CharField(max_length=1024)
type = models.CharField(max_length=256)
lang = models.CharField(max_length=32)
def __unicode__(self):
return self.displayString
However when I try to add a new work using the admin interface I get:
<class 'artbase.models.Title'> has more than 1 ForeignKey to <class
'artbase.models.Work'>
I'm sure it's a simple mistake on my part.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---