Hi, I'm trying to do a query where I select all rows where a field is
divisible by 2. In pure SQL this is what I want:
select * from contenido_semestre where num % 2 = 0;
which works fine. When trying to do it with Django I do
Semestre.objects.extra(where=['num % 2 = 0'])
But this gets me an empty list as a result (I'm using the exact same
database for testing).

The problem seems to be only with the modulo operation, using 'num + 2 = 4'
for example works correctly.

Is this a bug or by design. And what would you suggest as a workaround? I'd
rather not do custom SQL but will if it is the only other option.

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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