http:// jon-walsh.com / journal / 2010 / 06 / django-null-issues /

Django Null Issues

This is a quick post to save people from the confusion I just went through…

Issue: Django raises a validation error for a blank field that is set to allow blank and/or null

Reason: This a gotcha. Although the models may be setup correctly, the validation error comes from the database. If you’ve added the null and/or blank attributes after a syncdb, then the database will still be setup to validate via the old model setup.

Solution: Recreate the model’s table or alter the specific field with SQL.

Hope this helps someone :)

Posted on the 11th June 2010 at 5:18pm
In the category: Quick Fixes
This post was written by a mere human so errors are definitely possible, please let me know if you find any! :)
The Emotional Fog

Respond