summaryrefslogtreecommitdiff
path: root/django/db/models/sql/where.py
AgeCommit message (Collapse)Author
2010-06-21[soc2010/query-refactor] Cleaned up implementation of negation in MongoDB, ↵Alex Gaynor
and no longer rely on a feature from MongoDB unstable version. git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2010/query-refactor@13368 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-04-21Fixed #13328 -- Ensured that querysets on models with callable defaults can ↵Russell Keith-Magee
be pickled. No, really this time. Thanks to Alex for his help brainstorming the solution. git-svn-id: http://code.djangoproject.com/svn/django/trunk@13013 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-02-23Fixed #12855 -- QuerySets with `extra` where parameters now combine ↵Justin Bronn
correctly. Thanks, Alex Gaynor. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12502 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-22Fixed #1142 -- Added multiple database support.Russell Keith-Magee
This monster of a patch is the result of Alex Gaynor's 2009 Google Summer of Code project. Congratulations to Alex for a job well done. Big thanks also go to: * Justin Bronn for keeping GIS in line with the changes, * Karen Tracey and Jani Tiainen for their help testing Oracle support * Brett Hoerner, Jon Loyens, and Craig Kimmerer for their feedback. * Malcolm Treddinick for his guidance during the GSoC submission process. * Simon Willison for driving the original design process * Cal Henderson for complaining about ponies he wanted. ... and everyone else too numerous to mention that helped to bring this feature into fruition. git-svn-id: http://code.djangoproject.com/svn/django/trunk@11952 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-08Fixed #10432 -- Handle all kinds of iterators in queryset filters.Malcolm Tredinnick
Only consumes the iterators once and works with Python 2.3. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9986 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-02Fixed #10181 -- Handle an EmptyResultSet exception case properly in nested ↵Malcolm Tredinnick
querysets. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9951 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-02-23Fixed #10182 -- Corrected realiasing and the process of evaluating values() ↵Russell Keith-Magee
for queries with aggregate clauses. This means that aggregate queries can now be used as subqueries (such as in an __in clause). Thanks to omat for the report. This involves a slight change to the interaction of annotate() and values() clauses that specify a list of columns. See the docs for details. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9888 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-02-08Fixed #10160 -- Modified evaluation of F() expressions to protect against ↵Russell Keith-Magee
potential SQL injection attacks. Thanks to Ian Kelly for the suggestion and patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9820 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-02-08Fixed #7672 -- Added a 'week_day' lookup type. Many thanks to Ross Poulton ↵Karen Tracey
for the proposal and implementation on all built-in database backends.. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9818 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-01-29Fixed #7210 -- Added F() expressions to query language. See the ↵Russell Keith-Magee
documentation for details on usage. Many thanks to: * Nicolas Lara, who worked on this feature during the 2008 Google Summer of Code. * Alex Gaynor for his help debugging and fixing a number of issues. * Malcolm Tredinnick for his invaluable review notes. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9792 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-01-08Using querysets as an rvalue in filter() calls was causing an unnecessaryMalcolm Tredinnick
database query, due to a bool() call. This change stops that behaviour. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9715 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-01-05Reconciling where- and having-clause behaviour.Malcolm Tredinnick
Extricated the code that works directly with SQL columns (standard "where" stuff) from the the code that takes SQL fragments and combines it with lookup types and values. The latter portion is now more generally reusable. Any existing code that was poking at Query.having will now break in very visible ways (no subtle miscalculations, which is a good thing). This patch, en passant, removes the existing "having" test, since the new implementation requires more setting up than previously. The aggregates support (currently in a separate codebase) has tests for this functionality that work as a replacement for the removed test. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9700 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-23Allow for matches against unsaved objects in querysets (which will thereforeMalcolm Tredinnick
match nothing). This allows for some more straightforward code in the admin interface. Fixed #7488 (all the debugging there was done by Brian Rosner, who narrowed it down to the item in this patch). git-svn-id: http://code.djangoproject.com/svn/django/trunk@8061 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-04Redo the changes in [7773] in a better way.Malcolm Tredinnick
This removes some of the leaky abstraction problems (lifting WhereNode internals into the Query class) from that commit and makes it possible for extensions to WhereNode to have access to the field instances. It's also backwards-compatible with pre-[7773] code, which is also better. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7835 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-27Removed a dead line that was left in [7773] by accident.Malcolm Tredinnick
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7774 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-27Reorganised the internals of the Where node a bit to fix some copying problems.Malcolm Tredinnick
We no longer store any reference to Django field instances or models in the Where node. This should improve cloning speed, fix some pickling difficulties, reduce memory usage and remove some infinite loop possibilities in odd cases. Slightly backwards incompatible if you're writing custom filters. See the BackwardsIncompatibleChanges wiki page for details. Fixed #7128, #7204, #7506. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7773 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-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-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