The same question was already asked on SO in 2010 here , with the most recent answer being from 2014. I would like to know if this was easier with current django 2.0. I could not find anything about this in the docs.
In django docs for model inheritance, the example lists the models Placeand Restaurantas such
from django.db import models
class Place(models.Model):
name = models.CharField(max_length=50)
address = models.CharField(max_length=80)
class Restaurant(Place):
serves_hot_dogs = models.BooleanField(default=False)
serves_pizza = models.BooleanField(default=False)
Say I already have an object in Place, how can I raise it to Restaurant?
shadi source
share