Ticket #14757: querysets.txt.diff
File querysets.txt.diff, 979 bytes (added by , 13 years ago) |
---|
-
docs/ref/models/querysets.txt
786 786 787 787 SELECT * FROM blog_entry WHERE id IN (3, 4, 5, 20); 788 788 789 Example with ``tables``:: 790 791 Entry.objects.extra(tables=['blog_blog'], where=['name=%s'], params=['Beatles Blog']) 792 793 ...translates (roughly) into the following SQL:: 794 795 SELECT blog_entry.* FROM blog_entry, blog_blog WHERE name='Beatles Blog'; 796 797 In the previous case, a more portable solution would be to simply use ``filter()``:: 798 799 Entry.objects.filter(blog__name='Beatles Blog') 800 789 801 Be careful when using the ``tables`` parameter if you're specifying 790 802 tables that are already used in the query. When you add extra tables 791 803 via the ``tables`` parameter, Django assumes you want that table included