On 09-12-13 5:46 PM, Osiaq wrote:
>       properties = Property.objects.filter( Q(city=t) | Q(category=c ) | Q
> (status=s) )
> Goal:
> Find all the properties in 'city' no matter of category or status

Well you haven't told us what your models look like so we can't really 
be sure what you mean. If a Property has a ForeignKey of City, then: 
Property.objects.filter(city=t) might work.

 >  From the other side: find all the properties that belongs to
 > 'category' no matter of  'status' or 'city'  and so on

Assuming category is meaningful on property this would be: 
Property.objects.filter(category=c)...

All I can really say is: 
http://docs.djangoproject.com/en/dev/ref/models/querysets/

> OR doesn't work properly as well as AND

If you want help you will need to be more specific. "doesn't work 
properly" is not useful information.
-- 
   Andy McKay, @clearwind
   Whistler conference: http://clearwind.ca/djangoski/

--

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