On 5/1/07, Baurzhan Ismagulov <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> I have a class Object(models.Model) which contains model.BooleanFields.
> I'm trying to add rows to it, like this:
>
> o = Object()
> o.a1 = 'a1'
> o.a2 = 'a2'
> o.save()
>
> I don't set boolean values here. save() results in the following
> ProgrammingError:
>
> ERROR: invalid input syntax for type boolean: "" INSERT INTO "info_object" 
> (...) VALUES (..., '', '', ''...)
>
> Boolean fields have the value ''. Should I initialize all the fields to
> false either in code, or in the constructor? I would expect that Django
> does this for me.

if you want that you have to supply default value via default kwarg to the field

>
> How should I fix the problem?

be sure to initialize your fields, either with default, in save() or manually

I'm using Django r4431. Please CC to me,
> I'm temporarily not receiving mail from the list.
>
> Thanks in advance,
> --
> Baurzhan Ismagulov
> http://www.kz-easy.com/
>
> >
>


-- 
Honza Kr�l
E-Mail: [EMAIL PROTECTED]
ICQ#:   107471613
Phone:  +420 606 678585

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