Thanks for the reply. The base model just looks like this:

class ArtBaseModel(models.Model):
    created = models.DateTimeField() # models.DateTimeField(editable=False)
    modified = models.DateTimeField() # models.DateTimeField(editable=False)

    def save(self):
        if not self.id:
            self.created = datetime.datetime.today()
        self.modified = datetime.datetime.today()
        super(ArtBaseModel, self).save()

On Sat, Oct 24, 2009 at 7:56 AM, Tom Evans <tevans...@googlemail.com> wrote:

>
> On Fri, 2009-10-23 at 13:22 -0700, David Nolen wrote:
> > 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.
> >
>
> What does ArtBaseModel look like, that's the interesting bit.
>
> Cheers
>
> Tom
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to