5👍
✅
Here is my workaround:
sixth_ave_restaurant = Restaurant(place_ptr=sixth_ave_street_vendor,
serves_hot_dogs=True,
serves_pizza=True)
sixth_ave_restaurant.save_base(raw=True)
And if you want to do something else with sixth_ave_restaurant
, you should get it again, because its id
is not assigned yet, as it gets assigned after normal save()
:
sixth_ave_restaurant = Restaurant.objects.get(id=sixth_ave_street_vendor.id)
3👍
You should use place_ptr
instead of place
.
restaurant = Restaurant.objects.create(place_ptr=sixth_ave_street_vendor,
serves_hot_dogs=True, serves_pizza=True)
- [Django]-How to call multiple views on one url in pinax
- [Django]-Django log file permissions with uwsgi
- [Django]-Errors 404 and 500 while access static files in Django
- [Django]-Django 1.11 with celery 4.0 and djcelery compatibility issues
Source:stackexchange.com