rmschne wrote: > I have a query in Django with returns a queryset. > > c1=Contact.objects.filter(hostid__tablename=s) > > where "s" is a string holding a tablename. > > What I want to do is have Django return a query set where "s" is not > just a string, but a Python list, e.g. ['01','03','54']. > > How do i construct a query that would do this? I suspect it is not > the filter function, but can't spot something else that would work. > Thanks
c1=Contact.objects.filter(hostid__tablename__in=list_of_names) The ORM is cool. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.