Filtering on a property

209 views
Skip to first unread message

zwervertje

unread,
Dec 19, 2011, 3:53:08 AM12/19/11
to django-filter
Hey,

I tried to filter on a property of a model and this did not seem to
work?

Any pointers on how to get this working? The idea is that I would
like to count the amount of a certain object linked (foreignkey) to
the model and filter on the count with all values and values > 0...

Thanks!

Steve

unread,
Dec 19, 2011, 10:57:35 AM12/19/11
to django...@googlegroups.com
The properties don't exist in SQL so you can sooner filter your
neighbors by how many cats they have using Django's ORM than get what
you are trying to do working.

You just loop through and do whatever. Don't use filter. or django-filters.

zwervertje

unread,
Mar 6, 2012, 1:41:00 PM3/6/12
to django...@googlegroups.com
Hmm... My query returned one cat...  Thanks for the answer!


On Monday, December 19, 2011 4:57:35 PM UTC+1, Subsume wrote:
The properties don't exist in SQL so you can sooner filter your
neighbors by how many cats they have using Django's ORM than get what
you are trying to do working.

You just loop through and do whatever. Don't use filter. or django-filters.

Reply all
Reply to author
Forward
0 new messages