summaryrefslogtreecommitdiff
path: root/django/db/models/sql
AgeCommit message (Collapse)Author
2008-06-26Fixed #7181 -- when ordering by a potentially NULL field, use a left-outer joinMalcolm Tredinnick
so that the ordering doesn't accidentally restrict the result set. (Ironically, one existing test actually showed this problem, but I was too dumb to notice the result was incorrect.) git-svn-id: http://code.djangoproject.com/svn/django/trunk@7761 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-26Fixed #7076 -- Include NULL values when excluding non-NULL items.Malcolm Tredinnick
Based on a patch from emulbreh. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7760 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-26Fixed a problem when constructing complex select_related() calls.Malcolm Tredinnick
Avoids joining with the wrong tables when connecting select_related() tables to the main query. This also leads to slightly more efficient (meaning less tables are joined) SQL queries in some other cases, too. Some unnecessary tables are now trimmed that were not previously. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7741 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-26Fixed a problem with values() and values_list() queries and nullable joins.Malcolm Tredinnick
Previously, if we were querying across a nullable join and then a non-nullable one, the second join would not be a LEFT OUTER join, which would exclude certain valid results from the result set. This is the same problem as [7597] but for values() field specifications, so this covers the second case where Django adds extra stuff to the select-clause. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7740 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-15Fixed #7387 - Fixed circular import problem when importing ↵Gary Wilson Jr
`contrib.contenttypes.generic` module. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7635 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-12Negligible comment typo fixesAdrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7620 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-08Fixed #7369: fixed a corner-case involving select_related() following ↵Jacob Kaplan-Moss
non-null FKs after null ones. Thanks, George Vilches git-svn-id: http://code.djangoproject.com/svn/django/trunk@7597 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-04-29Fixed an Oracle error on double negations in where conditions. Fixed #7111Ian Kelly
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7509 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-04-28Changed Query.get_columns() to quote the 'AS' column names in an ↵Adrian Holovaty
extra_select situation, to match pre-queryset-refactor behavior. Added unit tests that verify this and provide an example git-svn-id: http://code.djangoproject.com/svn/django/trunk@7502 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-04-28Added the ability to pickle and unpickle QuerySets and Query classes.Malcolm Tredinnick
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7499 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-04-28Made some types of nested update queries very slightly more efficient at theMalcolm Tredinnick
database level. Also worked around the fact that MySQL (and maybe other backends we don't know about) cannot select from the table they're updating. Fixed #7095. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7496 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-04-28Fixed #7096 -- The simplifications in [7461] weren't complete. They brokeMalcolm Tredinnick
multi-component exclude() calls. Fixed that. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7493 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-04-28Fixed #7098 -- Old-style related-model order_by() syntax was being incorrectlyMalcolm Tredinnick
marked as erroneous. It's just more dangerous and risky, not forbidden. This commit restores backwards compatibility there. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7490 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-04-28Migrated _setup_query() docstring to AmericaAdrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7488 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-04-28Fixed #7097 -- dates() queries now work as expected with select_related() -- ↵Adrian Holovaty
that is, select_related() has no effect on the query. Thanks for reporting, Marco git-svn-id: http://code.djangoproject.com/svn/django/trunk@7486 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-04-27Merged the queryset-refactor branch into trunk.Malcolm Tredinnick
This is a big internal change, but mostly backwards compatible with existing code. Also adds a couple of new features. Fixed #245, #1050, #1656, #1801, #2076, #2091, #2150, #2253, #2306, #2400, #2430, #2482, #2496, #2676, #2737, #2874, #2902, #2939, #3037, #3141, #3288, #3440, #3592, #3739, #4088, #4260, #4289, #4306, #4358, #4464, #4510, #4858, #5012, #5020, #5261, #5295, #5321, #5324, #5325, #5555, #5707, #5796, #5817, #5987, #6018, #6074, #6088, #6154, #6177, #6180, #6203, #6658 git-svn-id: http://code.djangoproject.com/svn/django/trunk@7477 bcc190cf-cafb-0310-a4f2-bffc1f526a37