Hi!

I have the following model:

class MyModel(models.Model):
    maxwidth = models.IntegerField(Maximum width', default = '0')
    width = models.IntegerField('Width', default = '0')

I need to perform a query similar to this:

SELECT * FROM mymodel WHERE width > maxwidth;

The result should be a queryset, since I need it as filter in a long
chain of filters. Moreover, I need it to be able to be OR'ed to some
other querysets, so I found a simple .extra(where = ['width >
maxwidth']) won't work (the WHERE clause is placed in a wrong
position).

How can I do it? Maybe a forged Q object? Well, I'm stuck.
--~--~---------~--~----~------------~-------~--~----~
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