ops, this doesn't work, because the the Quiz model is pointing to the User model, and i want to filter on the quiz model and get the matching User instances. but in the example in the docs, the query is on the parent model.
quiz_qs = Quiz.objects.filter(score__gt=90) User.objects.filter(quiz__in=quiz_qs) is not possible as User does not have a quiz attribute. and daniel, yours, saying "user.id in Quiz queryset" does not look ok: User.objects.filter(id__in=Quiz.objects.filter(score__gt=90)) Still stuck. Any ideas? -- oMat On May 24, 4:58 pm, omat <o...@gezgin.com> wrote: > @cliff: you are right, but i am writing an extension to an existing > app. i want to use the models as-is if possible. > > i found the part in the docs: > > inner_qs = Blog.objects.filter(name__contains='Cheddar') > entries = Entry.objects.filter(blog__in=inner_qs) > > thanks. > > On May 24, 4:22 pm, Tomasz Zieliński > > > > > > <tomasz.zielin...@pyconsultant.eu> wrote: > > On 24 Maj, 08:58, Daniel Roseman <dan...@roseman.org.uk> wrote: > > > > User.objects.filter(id__in=Quiz.objects.filter(score__gt=90)) > > > Nice thing, is it documented somewhere (I think I haven't this > > before) ? > > > -- > > Tomasz Zielinskihttp://pyconsultant.eu > > > -- > > 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 > > athttp://groups.google.com/group/django-users?hl=en. > > -- > 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 > athttp://groups.google.com/group/django-users?hl=en. -- 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.