Tuesday, June 22, 2010

Fields validating as optional

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.

--
→ Jonathan Hayward, christos.jonathan.hayward@gmail.com
→ An Orthodox Christian author: theology, literature, et cetera.
→ My award-winning collection is available for free reading online:
☩ I invite you to visit my main site at http://JonathansCorner.com/

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

No comments:

Post a Comment