How to use TYPE_BOOLEAN

18 views
Skip to first unread message

Adrien Lemaire

unread,
Feb 24, 2012, 12:12:24 AM2/24/12
to eav-django
Hi there,

I'm not sure if I'm using TYPE_BOOLEAN correctly, the tests being
quite short (3 lines) for that type.

I have to create a schema, then 2 choices 'Yes' and 'No' to be able
to create attrs for my model. But I expected no having to create those
choices. a TYPE_BOOLEAN should obviously be 0 or 1 isn't it ? do we
really need to create a bunch of true/false choices for each of our
TYPE_BOOLEAN schema ? Seems quite redundant.

Thanks for your answer

Cheers
Adrien Lemaire

zzart

unread,
Feb 24, 2012, 1:08:03 PM2/24/12
to eav-django
Hi Adrien,Im by no means an expert but Boolean fields don't
necessarily need to be labeled 'yes' and 'no'. What if i need 'pees'
or 'bens' or in my real case 'default' and 'custom' ? Been able to
label stuff the way it fits ur application doesn't seem redundant to
me ... One more thing to note is that EAV uses NullBooleanField a
suppose to BooleanField which gives u this additional Null for not
selected options. greets,
Reply all
Reply to author
Forward
0 new messages