On Mon, Nov 9, 2009 at 01:11, Edward McCaughan wrote:
> where you're getting results where a property matches a value, could
> you have it try anything in a list of values, eg:
> ObjectOne.objects.filter(name=["toast","bread","shoes"])
>
http://docs.djangoproject.com/en/dev/ref/models/querysets/#
if you use custom user model, you could select user with related sets
and filter out record having at least one FK empty.
I think you could try
a) run own, custom query
b) use extra() function on queryset - but again, it should be used
agains User model
c) use database view
--~--~-~--~--
one more thing:
another way to look at it (hence the original title) would be instead
of a normal queryset, eg:
ObjectOne.objects.filter(name="toast")
where you're getting results where a property matches a value, could
you have it try anything in a list of values, eg:
ObjectOne.objects.filter(n
I have a complicated query set to do, does anyone have any suggestions
on the least insane way to do it?
I need to merge two querysets and only get out ones with a common
field:
ModelOne.objects.filter(x=whatever)
ModelTwo.objects.filter(y=foo)
both of these objects have a property which is a d
4 matches
Mail list logo