I have defined a zip code field as follows in my Address model:

zip = models.IntegerField(blank=True, null=True)

Being a good Djangonaut, I'm using a ModelForm to convert my address
model into HTML.  Now this where things get dicey.  As you can see in
the model, zip code can except empty values.  Unfortunately, when I
attempt to save data entered by a user who has left the zip code field
blank, I receive a database exception.  Apparently, Django is
attempting to insert an empty string into my integer-only field.

>From what I can tell, this particular topic has been discussed
previously:

http://www.hoboes.com/Mimsy/?ART=595

Is the solution outlined in the blog post above the long-term solution
for Django developers or are there plans to have a ModelForm
understand that I would not want to insert an empty string into an
integer field?

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to