Tim Chase wrote:
>> How can I retrieve all objects that are *not* in that list?
>>
>> Something like "Model.objects.filter(id__not_in = processed_ids)".
>> Unlike filter(id__in=...) which works just fine the __not_in modifier
>> apparently isn't understood by django.
> 
> 
> As commented recently on the list, you want "filter()"'s evil
> twin "exclude()":
> 
>   exclude(id_in=...)

That's it. Thanks.

Now with the above example if I don't have a list of IDs but a list of
the processed objects I'm not able to pass these as an argument to the
__in operator.

This: Model.objects.filter(...).exclude(id__in = processed)
gives me: Truncated incorrect DOUBLE value: 'Model object'

I have to use id__in=[p.id for p in processed] instead.

Am I doing something wrong again or is it expected behaviour?

Thanks

Michal





--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
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