In Django, when I have inherited models, how can I do to make promotion/demotion possible in the admin interface ?
Example :
# models.py
class Person(models.Model):
name=models.CharField()
class Artist(Person):
medium=models.CharField()
classScientist(models.Model):
field=models.CharField()
# admin.py
admin.site.register(Person)
admin.site.register(Artist)
admin.site.register(Scientist)
So in the admin, I can create a person, or an artist, or a scientist in one step.
But:
- once a Person is created, I can't promote that person to a WorkingPerson (which would need to add a row in the WorkingPerson table without creating a new Person).
- once a WorkingPerson is created, I can't demote that persone to a Person (which would need to delete the row in the WorkingPerson table only).
Thanks a lot !
Olivier