Saturday, April 27, 2013

Django Admin - BooleanField issue

I've setup a boolean field and get it to display correctly using this in my model:
active = models.BooleanField(choices=((1,'yes'),(0,'no')))

However, when I edit a record in the Django Admin, the select field always shows "yes" regardless of the database value.

Saving "yes" or "no" stores the correct 1 or 0; is there a bug in the edit form?  Or did I miss a setting?


You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
For more options, visit

No comments:

Post a Comment