It doesn't seem to me that changing the behavior at this point is worth possible backwards incompatibilities.
On Friday, January 22, 2016 at 2:51:41 PM UTC-5, Kaveh wrote: > > Today I discovered I can use strings and numbers to query on BooleanFields. > > Let's say we have the following model: > > class Whatever(models.Model): > name = models.CharField(max_length=200) > is_active = models.BooleanField() > > The following queries return all instances which their `is_active` field > is True: > > Whatever.object.filter(is_active=True) > Whatever.object.filter(is_active='some_random_text') > Whatever.object.filter(is_active=777) > > and the followings return the ones which are False: > > Whatever.object.filter(is_active=False) > Whatever.object.filter(is_active='') > Whatever.object.filter(is_active=0) > > Is this behaviour intentional or is it a bug? Should queries on > BooleanFields accept strings and numbers? > -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To post to this group, send email to django-developers@googlegroups.com. Visit this group at https://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/5d4ff4a5-17c6-4bc9-9a11-14a1d2bf0650%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.