I think your best bet is

MyModel.objects.filter(some_field__in=ok_values).count() == len(ok_values)

On Wed, Mar 30, 2011 at 12:44 PM, dmitry b <dmitry.ma...@gmail.com> wrote:
> Hi,
>
> is there a way to check in bulk for record existence and get back a
> map of results similar to what's returned by in_bulk().  In my case, I
> need to look up records by a unique field which is not the primary key
> and I don't want object instances back, just true or false.
>
>
> Thanks
> Dmitry
>
> --
> 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.
>
>



-- 
Read my blog! I depend on your acceptance of my opinion! I am interesting!
http://techblog.ironfroggy.com/
Follow me if you're into that sort of thing: http://www.twitter.com/ironfroggy

-- 
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