更新时间:2023-12-02 21:39:04
多表继承只是Place和Restaurant之间的 OneToOneField
关系。
Multi-table inheritance is just OneToOneField
relation between Place and Restaurant.
place = Place.objects.get(id=1)
# Create a restaurant using existing Place
restaurant = Resturant(place_ptr=place)
restaurant.save()