In SQL, you can retrieve a list of records via the "IN" syntax:
SELECT * FROM mytable WHERE id IN (1,2,3,4,5,6);
Django supports near-identical syntax:
MyTableModel.objects.filter(id__in=[1,2,3,4,5,6])
nice!
Monday, February 15, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment