Thanks for the suggestion Daniel, but that doesn't help either :\

This will raise a field error (bff_id is not a valid field, only bff
is)
Person.objects.exclude(bff_id=None)

And these both result in JOINs:
Person.objects.exclude(bff=None)
Person.objects.exclude(bff__id=None)

Perhaps there is an optimization to be made at the Django ORM level?

jb

On Nov 4, 11:32 am, Daniel Roseman <dan...@roseman.org.uk> wrote:
> On Nov 4, 7:22 pm, John Boxall <bisha...@gmail.com> wrote:
>
> > Both of these will raise a FieldError:
>
> > people_with_bffs = Person.objects.filter(bbf_id__isnull=False)
> > people_with_bffs = Person.objects.filter(bbf_pk__isnull=False)
>
> > Cannot resolve keyword 'bbf_pk' into field. Choices are 'bbf'.
>
> > Thanks for the suggestion though!
>
> > jb
>
> Try Person.objects.exclude(bbf_id=None)
> --
> DR.
--~--~---------~--~----~------------~-------~--~----~
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