On Mon, 2009-02-02 at 21:51 -0800, Brandon Taylor wrote:
> Hi everyone,
> 
> I need to return a queryset using the "in" statement. My IDs are in an
> array of int values.
> 
> vehicle_ids = [1, 2, 3]
> 
> If I do: vehicles = VehiclePhoto.objects.filter(vehicle__id__in=
> [vehicle_ids])

You're passing a list of lists there, since vehicle_ids is already a
list. Surely you want vehicle__id__in=vehicle_ids?

The error message you're seeing supports that: the DB wrapper is
iterating over the first element of the list and ends up trying to treat
it as a string, since it's not some other type it knows about and things
go downhill from there.

Regards,
Malcolm



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