0👍
If you want it to be possible to have an empty value for author
, you need to define the ForeignKey with null=True
. You’ll probably want blank=True
as well, as that controls the validation in Django forms.
author = models.ForeignKey(User, null=True, blank=True)
0👍
Ended up taking the easy route and totally resetting the product table, and migrating from scratch which worked. Not sure i’ve learnt anything (other than how to reset an app)!
👤null
- [Django]-Setting number of gunicorn workers in django settings.py
- [Django]-Is there a better way to check if the values of an AJAX request are valid?
- [Django]-Adding new form fields dynamically in admin
- [Django]-Django with django-nose: two identical settings files with different behavior in running test command
Source:stackexchange.com