On Friday 07 July 2006 14:17, Malcolm Tredinnick wrote: > Let's try this again... take two... (it's still an interesting > question)..
I'm glad it took you some time to answer, I always feel reassuring to see that more skilled people scratch their head on my problems too. I feel less dumb. :)) > Looking at the SQL queries we generate, I cannot see a way to do what > you want without writing a fragment of custom SQL. It almost feels like > this should be easier, although I am normally fairly conservative about > adding new functionality. Something to think about, certainly. > > Anyway, to achieve what you want to do, this will work: > > Reporter.objects.extra(where = ['id not in (select reporter_id from > app4_article)']) Hey, that works great, indeed, thank you. By the way, is there a mean to use this extra() request in a limit_choices_to field option? I can't figure how to use custom SQL in a Q object. That said, from my point of view, it would certainly be very convenient to have a way to get those records without extra SQL. Something like a isdefined lookup type (ala isnull). > > Sorry again about the bogus answer earlier. I am going to try and be > more careful in future. That was just dumb. Don't mind, really. I already sincerely appreciate you took time to look after this. Thanks a lot. Kudos! -- Kilian CAVALOTTI Administrateur réseaux et systèmes UPMC / CNRS - LIP6 (C870) 8, rue du Capitaine Scott Tel. : 01 44 27 88 54 75015 Paris - France Fax. : 01 44 27 70 00 --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~----------~----~----~----~------~----~------~--~---