0👍
✅
I found the answer. Its how you include choices in django forms. So CATEGORY_CHOICES
has to be a list of tuples, which it was not in this case.
Thus, this simple change made it work:
CATEGORY_CHOICES = [('', cat.title)
for cat in Category.objects.all()]
1👍
The FormView
supplies a context variable called form
that holds your actual form object, so you can use:
{{ form.as_table }}
Or any of the other rendering options that form
supplies. See: https://docs.djangoproject.com/en/dev/topics/forms/#displaying-a-form-using-a-template
👤knbk
- [Answer]-What fields available in DatabaseError? (django/python)
- [Answer]-Celery worker not able to access files created by Django application on Heroku
- [Answer]-After adding Django CMS to my project, management commands fail with a cache error. How can I fix it?
Source:stackexchange.com