I have a django model and model form that look like this:
-models.py
class Menu_Category(models.Model):
merchant = models.ForeignKey(Merchant, related_name='menu_categories')
name = models.CharField(max_length=64)
test_field = models.CharField(max_length=20)
def __unicode__(self):
return self.name
-forms.py
class MenuCategoryForm(ModelForm):
class Meta:
model = Menu_Category
fields = ('name')
The problem i'm experiencing is that when I only select one field from the form to display (fields = ('name')
) the form does not display anything nor do i get any errors. It is completely blank. However, when I add a second field fields = ('name','test_field')
the form displays both fields just fine. Is there a minimum number of fields a form can display?
Thanks in advance.