Django admin GenericForeignKey inline -


class myuser(abstractbaseuser):     ...     content_type = models.foreignkey(contenttype, limit_choices_to={"model__in": ("agentprofile", "clientprofile"))     object_id = models.positiveintegerfield()     profile = generic.genericforeignkey('content_type', 'object_id')  class agentprofile(models.model):     license_number = models.charfield(max_length=50, blank=true)  class clientprofile(models.model):     address = models.charfield(max_length=250) 

i have 3 models: myuser(custom user model), clientprofile, agentprofile. how can edit clientprofile/agentprofile on myuser admin page (like inline)?

you need use generictabularinline. see django docs.


Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -