I have a code that follows an example for inheriting multiple tables, as indicated on the documentation page: http://docs.djangoproject.com/en/dev/topics/db/models/#multi-table-inheritance . I am trying to create a restaurant around the place.
I have already created a place, and I want to make the restaurant this way:
>>> p = Place.objects.get(id=12)
>>> p.restaurant
<Restaurant: ...>
>>> r = Restaurant(p)
but I just get this error:
TypeError: int() argument must be a string or a number, not 'Place'
I want to add more information to my models, so I donβt want to enter and manually set all fields equal. is there anyway to do this?
source
share