I have two django models like these:
class Place(models.Model):
name = models.CharField(max_length=50)
address = models.CharField(max_length=80)
class Restaurant(Place):
serves_hot_dogs = models.BooleanField()
serves_pizza = models.BooleanField()
I had previously created a Place
instance, like this:
sixth_ave_street_vendor = Place(name='Bobby Hotdogs', address='6th Ave')
sixth_ave_street_vendor.save()
Now bobby has upgraded his street vendor to a restaurant. How can I do that in my code?! Why this code doesn't work:
sixth_ave_restaurant = Restaurant(place=sixth_ave_street_vendor,
serves_hot_dogs=True,
serves_pizza=True)
sixth_ave_restaurant.save()