Does Django guarantee that, if an ordering is specified on a
BooleanField of a model, that it will order the same way across
supported databases?  E.g.

  class MyModel(Model):
    active = BooleanField()
    name = CharField(...)
    class Meta:
        ordering = [
            "-active",
            "name",
            ]
    def __unicode__(self):
      s = self.name
      if not self.active:
        s += " (inactive)"
      return s

Would this be sufficient to guarantee that my inactive items would be
sorted after my active items regardless of the (supported) database
I use?  Based on some cursory testing with sqlite, it worked but I
didn't see anything in the docs about sorting Booleans (or nullables
for that matter).

Thanks,

-tkc



-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/20140510132316.6fa24107%40bigbox.christie.dr.
For more options, visit https://groups.google.com/d/optout.

Reply via email to