Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/django/db/models/expressions.py
Commit message (Collapse)AuthorAgeFilesLines
* Refs #25629 -- Added `arity` class attribute to `Func` ↵Sergey Fedoseev2015-11-021-0/+10
| | | | expressions
* Fixed #24509 -- Added Expression support to ↵Alex Hill2015-09-221-0/+21
| | | | SQLInsertCompiler
* Fixed #25377 -- Changed Count queries to execute ↵Adam Chainz2015-09-141-0/+8
| | | | COUNT(*) instead of COUNT('*').
* Fixed #18247 -- Added cast to NUMERIC for Decimals on sqliteMichael Tänzer2015-07-011-0/+9
| | | | | | On sqlite the SUM() of a decimal column doesn't have a NUMERIC type so when comparing it to a string literal (which a Decimal gets converted to in Django) it is not compared as expected.
* Fixed #24752 -- query crash when reusing Case expressionsAnssi Kääriäinen2015-05-051-0/+5
| | | | | Case expressions weren't copied deep enough (self.cases list was reused resulting in an error).
* Fixed #24485 -- Allowed combined expressions to set ↵Josh Smeaton2015-03-221-3/+26
| | | | output_field
* Fixed #24508 -- Made annotations commutativeJosh Smeaton2015-03-221-2/+12
|
* Refs #24485 -- Renamed some expression typesJosh Smeaton2015-03-171-19/+19
|
* Fixed #24486 -- Fixed error with datetime and ↵Josh Smeaton2015-03-171-3/+4
| | | | DurationField arithmetic
* Fixed #24420 -- Allowed ordering by case expressionsJosh Smeaton2015-03-061-0/+5
|
* Update converters to take a consistent set of parameters.Marc Tamlyn2015-02-201-3/+3
| | | | | | As suggested by Anssi. This has the slightly strange side effect of passing the expression to Expression.convert_value has the expression passed back to it, but it allows more complex patterns of expressions.
* Fixed #24343 -- Ensure db converters are used for ↵Marc Tamlyn2015-02-201-5/+8
| | | | | | foreign keys. Joint effort between myself, Josh, Anssi and Shai.
* Refs #14030 -- Improved expression support for python valuesJosh Smeaton2015-02-111-14/+12
|
* Sorted imports with isort; refs #23860.Tim Graham2015-02-061-1/+1
|
* Refs #14030 -- Renamed CombinableMixin to CombinableJosh Smeaton2015-01-281-5/+3
| | | | Removed unused method and updated docstrings.
* Refs #14030 -- Added repr methods to all expressionsJosh Smeaton2015-01-281-5/+45
|
* Fixed #24154 -- Backends can now check support for ↵Josh Smeaton2015-01-271-8/+7
| | | | expressions
* Fixed #24031 -- Added CASE expressions to the ORM.Michał Modzelewski2015-01-131-12/+148
|
* Fixed #24060 -- Added OrderBy ExpressionsJosh Smeaton2015-01-121-10/+67
|
* Fixed #24020 -- Refactored SQL compiler to use expressionsAnssi Kääriäinen2015-01-081-5/+44
| | | | | | | | | | | | | | | Refactored compiler SELECT, GROUP BY and ORDER BY generation. While there, also refactored select_related() implementation (get_cached_row() and get_klass_info() are now gone!). Made get_db_converters() method work on expressions instead of internal_type. This allows the backend converters to target specific expressions if need be. Added query.context, this can be used to set per-query state. Also changed the signature of database converters. They now accept context as an argument.
* Fixed null handling in Value expressionJosh Smeaton2015-01-081-0/+5
|
* Fixed #24033 -- Use interval type on Oracle.Marc Tamlyn2014-12-231-1/+2
| | | | | | | | | | | Use INTERVAL DAY(9) TO SECOND(6) for Durationfield on Oracle rather than storing as a NUMBER(19) of microseconds. There are issues with cx_Oracle which require some extra data manipulation in the database backend when constructing queries, but it handles the conversion back to timedelta objects cleanly. Thanks to Shai for the review.
* Fixed #2443 -- Added DurationField.Marc Tamlyn2014-12-201-41/+46
| | | | | | | | | | | A field for storing periods of time - modeled in Python by timedelta. It is stored in the native interval data type on PostgreSQL and as a bigint of microseconds on other backends. Also includes significant changes to the internals of time related maths in expressions, including the removal of DateModifierNode. Thanks to Tim and Josh in particular for reviews.
* Refs #24020 -- return expressions from get_group_by_cols()Anssi Kääriäinen2014-12-181-2/+2
|
* Fixed #23941 -- Removed implicit decimal formatting from ↵Josh Smeaton2014-12-121-1/+1
| | | | expressions.
* Fixed #23867 -- removed DateQuerySet hacksAnssi Kääriäinen2014-11-261-6/+66
| | | | | | The .dates() queries were implemented by using custom Query, QuerySet, and Compiler classes. Instead implement them by using expressions and database converters APIs.
* Fixed #23889 -- Added more usage of ↵Collin Anderson2014-11-211-1/+1
| | | | quote_name_unless_alias() to avoid deprecation warnings.
* Renamed qn to compilerJosh Smeaton2014-11-161-5/+6
|
* Fixed #14030 -- Allowed annotations to accept all ↵Josh Smeaton2014-11-151-62/+435
| | | | expressions
* Fixed #23492 -- Restored F.__deepcopy__.Baptiste Mispelon2014-09-161-0/+5
| | | | | This reverts commit 3a66035107a640c4905f0a5f247a45f32dbe16d7. A regression test was also added.
* Appeased flake8 2.1.0.Aymeric Augustin2014-04-211-3/+3
|
* Fixed #17027 -- Added support for the power operator in ↵Florian Hahn2013-10-221-0/+7
| | | | | | | | | | F expressions. Thanks dan at dlo.me for the initial patch. - Added __pow__ and __rpow__ to ExpressionNode - Added oracle and mysql specific power expressions - Added used-defined power function for sqlite
* Removed F.__deepcopy__()Anssi Kääriäinen2013-10-171-5/+0
| | | | The method didn't change standard __deepcopy__ in any way.
* A large number of stylistic cleanups across django/db/Alex Gaynor2013-07-081-0/+3
|
* Refactored qs.add_q() and utils/tree.pyAnssi Kääriäinen2013-03-131-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | The sql/query.py add_q method did a lot of where/having tree hacking to get complex queries to work correctly. The logic was refactored so that it should be simpler to understand. The new logic should also produce leaner WHERE conditions. The changes cascade somewhat, as some other parts of Django (like add_filter() and WhereNode) expect boolean trees in certain format or they fail to work. So to fix the add_q() one must fix utils/tree.py, some things in add_filter(), WhereNode and so on. This commit also fixed add_filter to see negate clauses up the path. A query like .exclude(Q(reversefk__in=a_list)) didn't work similarly to .filter(~Q(reversefk__in=a_list)). The reason for this is that only the immediate parent negate clauses were seen by add_filter, and thus a tree like AND: (NOT AND: (AND: condition)) will not be handled correctly, as there is one intermediary AND node in the tree. The example tree is generated by .exclude(~Q(reversefk__in=a_list)). Still, aggregation lost connectors in OR cases, and F() objects and aggregates in same filter clause caused GROUP BY problems on some databases. Fixed #17600, fixed #13198, fixed #17025, fixed #17000, fixed #11293.
* Fixed #18963 -- Used a subclass-friendly patternAymeric Augustin2012-11-031-4/+8
| | | | for Python 2 object model compatibility methods.
* Moved F() '&' and '|' to .bitand() and .bitor()Anssi Kääriäinen2012-10-101-7/+23
| | | | | | Done for consistency with Q() expressions and QuerySet combining. This will allow usage of '&' and '|' as boolean logical operators in the future. Refs #16211.
* Revert "Fixed #16211 -- Added comparison and negation ↵Anssi Kääriäinen2012-10-101-37/+0
| | | | | | | | | | ops to F() expressions" This reverts commit 28abf5f0ebc9d380f25dd278d7ef4642c4504545. Conflicts: docs/releases/1.5.txt
* Fixed #16211 -- Added comparison and negation ops to F() ↵Anssi Kääriäinen2012-09-301-0/+37
| | | | | | | expressions Work done by Walter Doekes and Trac alias knoeb. Reviewed by Simon Charette.
* [py3] Fixed F-expression right-hand divisionClaude Paroz2012-08-151-1/+2
| | | | Complementary to commit 62a9ed0ac.
* [py3] Fixed F-expression division operatorsAnssi Kääriäinen2012-08-141-1/+2
| | | | | In Python 3 dividing by int will call obj.__truediv__(). This operator was missing from F-expressions.
* Removed a bunch more Python 2.4 workarounds now that we ↵Adrian Holovaty2011-03-281-2/+0
| | | | | | don't support that version. Refs #15702 -- thanks to jonash for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15927 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #10154: Allow combining F expressions with ↵Karen Tracey2010-12-221-1/+42
| | | | | | timedelta values. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15018 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #1142 -- Added multiple database support.Russell Keith-Magee2009-12-221-4/+4
| | | | | | | | | | | | | | | | | 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
* Fixed #11753 - Q objects with callables no longer ↵Jacob Kaplan-Moss2009-12-171-1/+1
| | | | | | explode on Python 2.4. Thanks, Jeremy Dunck. git-svn-id: http://code.djangoproject.com/svn/django/trunk@11901 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Pass values through get_db_prep_save() in a ↵Malcolm Tredinnick2009-03-091-0/+3
| | | | | | | | | | | | QuerySet.update() call. This removes a long-standing FIXME in the update() handling and allows for greater flexibility in the values passed in. In particular, it brings updates into line with saves for django.contrib.gis fields, so fixed #10411. Thanks to Justin Bronn and Russell Keith-Magee for help with this patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10003 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #7210 -- Added F() expressions to query language. ↵Russell Keith-Magee2009-01-291-0/+110
See the 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