heya,

Hmm, I'm using generic.GenericTabularInline for the Address Inline, is
that the same?

class AddressAdmin(VersionAdmin):
    exclude = ('content_type', 'object_id',)
...
class AddressInline(generic.GenericTabularInline):
    model = Address
...
class HospitalAdmin(admin.ModelAdmin):
    inlines = [
        AddressInline,
    ]
...

Is there an error in the above?

Also, I'm still confused on whether I should have that exclude in
there? And the bug that Raffaele Salmaso pointed out (http://
code.djangoproject.com/ticket/12577), is that what's causing this?
(The traceback in the ticket is quite different to the traceback I'm
getting).

Cheers,
Victor

Cheers,
Victor

On Jan 19, 9:55 pm, Daniel Roseman <dan...@roseman.org.uk> wrote:
> On Jan 19, 10:35 am, Victor Hooi <victorh...@gmail.com> wrote:
>
> > heya,
>
> > Thanks for the reply =).
>
> > I tried that, and the fields aren't there, but when I try to save the
> > object, I get a:
>
> >     IntegrityError at /admin/people/address/add/
> >     people_address.content_type_id may not be NULL
>
> > so obvoiusly Django doesn't like it if those fields aren't filled.
>
> > How do people normally do this sort of thing, with a polymorphic
> > object that's referenced by multiple other objects?
>
> Edit the address inline with the parent object (hospital, etc) by
> using the generic.GenericInlineAdmin class - works exactly the same as
> a normal inline admin class, but using generic relations.
> --
> DR.
-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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