diff options
| author | Anssi Kääriäinen <akaariai@gmail.com> | 2012-10-03 18:53:40 +0300 |
|---|---|---|
| committer | Anssi Kääriäinen <akaariai@gmail.com> | 2012-10-10 01:15:29 +0300 |
| commit | b625e8272bd41714c838cfda3fb54e1f5177f009 (patch) | |
| tree | 7edc4b667914e12eaf4b2d74c22cdcb4e024d83e /docs | |
| parent | a8b1861fc4d0a48b4879af803bba094eef145017 (diff) | |
Moved F() '&' and '|' to .bitand() and .bitor()
Done for consistency with Q() expressions and QuerySet combining. This
will allow usage of '&' and '|' as boolean logical operators in the
future. Refs #16211.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/releases/1.5.txt | 6 | ||||
| -rw-r--r-- | docs/topics/db/queries.txt | 12 |
2 files changed, 18 insertions, 0 deletions
diff --git a/docs/releases/1.5.txt b/docs/releases/1.5.txt index 78ba77308b..263392fdc7 100644 --- a/docs/releases/1.5.txt +++ b/docs/releases/1.5.txt @@ -438,6 +438,12 @@ Miscellaneous needs. The new default value is `0666` (octal) and the current umask value is first masked out. +* The :ref:`F() expressions <query-expressions>` supported bitwise operators by + ``&`` and ``|``. These operators are now available using ``.bitand()`` and + ``.bitor()`` instead. The removal of ``&`` and ``|`` was done to be consistent with + :ref:`Q() expressions <complex-lookups-with-q>` and ``QuerySet`` combining where + the operators are used as boolean AND and OR operators. + Features deprecated in 1.5 ========================== diff --git a/docs/topics/db/queries.txt b/docs/topics/db/queries.txt index fa98c91739..543edf6280 100644 --- a/docs/topics/db/queries.txt +++ b/docs/topics/db/queries.txt @@ -640,6 +640,18 @@ that were modified more than 3 days after they were published:: >>> from datetime import timedelta >>> Entry.objects.filter(mod_date__gt=F('pub_date') + timedelta(days=3)) +.. versionadded:: 1.5 + ``.bitand()`` and ``.bitor()`` + +The ``F()`` objects now support bitwise operations by ``.bitand()`` and +``.bitor()``, for example:: + + >>> F('somefield').bitand(16) + +.. versionchanged:: 1.5 + The previously undocumented operators ``&`` and ``|`` no longer produce + bitwise operations, use ``.bitand()`` and ``.bitor()`` instead. + The pk lookup shortcut ---------------------- |
