On Wed, Jun 25, 2008 at 4:39 PM, Huuuze <[EMAIL PROTECTED]> wrote:

>
> Thanks for getting back to me.  You're correct -- that article is not
> a one-for-one match when compared to my problem, so let me tweak my
> question.
>
> When I attempt to save (my_form.save()) and I leave the zip code field
> blank, I receive the following exception:
>
> DataError at /person/new/add/
> invalid input syntax for integer: ""
>
> When I look at the insert statement, sure enough, an empty string is
> attempting to make its way into my zip code field.
>
> With that being said, do you expect that behavior?  If not, how can I
> correct the issue?  If you do expect that behavior, how can I go about
> creating a NullIntegerField?  This is new territory for me.
>

No, I don't expect that behavior.  If I have an IntegerField with
blank=True,null=True and create a ModelForm for the associated model, then
when I fill in the form and leave that field blank, Django inserts a null
into the database for that field, not a blank.  So something is going wrong
in your case.  What level of Django are you using?  Snippets from your code
might also help in identifying what is going wrong.

Karen

--~--~---------~--~----~------------~-------~--~----~
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