I'm using Django 1.8 and having trouble to because my form does not generate fields with required option even though they have the property "blank=False" in the model.
In the example bellow, shouldn't the field "description" have the "required" attribute in the html generated using "form.as_p" or am I missing anything?
class Place(models.Model):
name = models.CharField(max_length=200, blank=False, default='')
owners = models.ManyToManyField(settings.AUTH_USER_MODEL, blank=False)
members = models.ManyToManyField(Member, blank=True)
description = models.TextField(blank=False)
location = models.CharField(max_length=400, blank=True)
additional_info = models.TextField(blank=True)
def __unicode__(self):
class PlaceForm(ModelForm):
class Meta:
model = Place
fields = '__all__'
views.py
@login_required(login_url='/')
def addPlaceView(request):
place_form = PlaceForm()
context = {
'form': place_form,
}
return render(request, 'newPlace.html', context)