I have a query that is complex enough that, even if it can be done
with filter, exclude, and Qs, I find more maintainable as custom SQL.
That all works fine.

But I want to add the test of a boolean field in my WHERE clause, and
different databases represent true and false differently.
Specifically, during development, and probably for later bug fix
testing, I find it convenient to use sqlite, where true and false are
1 and 0, but we will likely deploy on PostgreSQL, where they (at least
as returned
by the command line tool) be t and f, and the documentation implies
that true and false will also work.

I can clearly check settings from django.conf to see which DB I'm
using, and adjust my queries, but it occurs to me that the ORM already
knows how to represent true and false for the current DB.

Is there a reasonable and unlikely to change way of programatically
asking the ORM for the representations?

Thanks, Bill

--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to