Multiple inheritance from models.Model and admin.ModelAdmin

131 views
Skip to first unread message

Lee

unread,
May 31, 2011, 1:36:51 PM5/31/11
to Django users
I'm trying to create a class that inherits from both models.Model and
admin.ModelAdmin, so that I can use models.ManyToManyField and
save_model() from admin.ModelAdmin. Unfortunately this combination
gives "metaclass conflict: the metaclass of a derived class must be a
(non-strict) subclass of the metaclasses of all its bases". I've
googled on the error message and tried a couple of the suggestions but
with no luck. Anyone know the correct way of doing this?

Thanks for any help.

Lee

Lee

unread,
May 31, 2011, 4:11:01 PM5/31/11
to Django users
Discovered that save_model() is still available even if I don't
inherit admin.ModelAdmin, which avoids the metaclass conflict.
Reply all
Reply to author
Forward
0 new messages