Well,

I figured this part out at least...
QNot(Q(field__filter='some value'))

Next Question. Is there a way to reference 'self.id' inside the model  
class, to exclude the current self from the select list? In my case,  
I have a self-referencing table of parents and children. I want to  
eliminate the possibility of a user entering/selecting a child as  
their own parent... hence the need to exclude.

If I use 'self.id' in my Q expression, the model returns "self  
undefined"

Help?

-D

On Dec 6, 2006, at 10:31 PM, Darin Lee wrote:

>
> Hi,
>
> I'm trying to figure out how to use inverted/NOT logic in the
> limit_choices_to argument for models.ForeignKey() fields. A google
> search turned up the following:
> http://code.djangoproject.com/ticket/1579
>
> This tracker comment indicates that this issue was/is resolved by
> adding support for 'Q' objects. The Q objects work fine, but for the
> life of me, I can't figure out how to 'invert' it? Does anyone have
> any pointers on how to make this work?
>
> Thanks in advance!
> D
>
> >


--~--~---------~--~----~------------~-------~--~----~
 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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to