On Jun 22, 9:11 pm, Jonathan Hayward
<christos.jonathan.hayw...@gmail.com> wrote:
> What is the preferred way to make e.g. a TextField that will pass validation
> if it is left empty? I've seen two approaches apparently referenced in the
> documentation:
>
>     additional_comments = models.TextField(required = False)
>
>     additional_comments = models.TextField(blank = True)
>
> and run into errors with the first. Does this mean that I should go with the
> second, or is there another way that is preferred?
>
> I'm using 1.2.

The first is just wrong, and certainly isn't documented in that form.
You seem to have wrongly conflated some of the syntax from the forms
documentation with the models docs.

Model fields take blank=True/False. Form fields take
'required=False' (or True) as a parameter. However, the field in that
case would be forms.CharField, not models.TextField.
--
DR.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to