Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
6b418348
Kaydet (Commit)
6b418348
authored
Haz 05, 2015
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Minor edits to Greatest/Least docs; refs #24767.
üst
286d0e6a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
15 deletions
+13
-15
functions.py
django/db/models/functions.py
+2
-4
database-functions.txt
docs/ref/models/database-functions.txt
+11
-11
No files found.
django/db/models/functions.py
Dosyayı görüntüle @
6b418348
...
...
@@ -89,8 +89,7 @@ class Greatest(Func):
If any expression is null the return value is database-specific:
On Postgres, the maximum not-null expression is returned.
On MySQL, Oracle and SQLite, if any expression is null, null is
returned.
On MySQL, Oracle, and SQLite, if any expression is null, null is returned.
"""
function
=
'GREATEST'
...
...
@@ -110,8 +109,7 @@ class Least(Func):
If any expression is null the return value is database-specific:
On Postgres, the minimum not-null expression is returned.
On MySQL, Oracle and SQLite, if any expression is null, null is
returned.
On MySQL, Oracle, and SQLite, if any expression is null, null is returned.
"""
function
=
'LEAST'
...
...
docs/ref/models/database-functions.txt
Dosyayı görüntüle @
6b418348
...
...
@@ -96,13 +96,13 @@ Usage example::
Greatest
--------
.. versionadded:: 1.9
.. class:: Greatest(*expressions, **extra)
.. versionadded:: 1.9
Accepts a list of at least two field names or expressions and returns the
greatest value. Each argument must be of a similar type, so mixing text and
numbers
will result in a database error.
greatest value. Each argument must be of a similar type, so mixing text and
numbers
will result in a database error.
Usage example::
...
...
@@ -121,8 +121,8 @@ Usage example::
>>> comments = Comment.objects.annotate(last_updated=Greatest('modified', 'blog__modified'))
>>> annotated_comment = comments.get()
``annotated_comment.last_updated`` will be the most recent of
``blog.modified``
and ``comment.modified``.
``annotated_comment.last_updated`` will be the most recent of
``blog.modified``
and ``comment.modified``.
.. warning::
...
...
@@ -131,19 +131,19 @@ Usage example::
- PostgreSQL: ``Greatest`` will return the largest non-null expression,
or ``null`` if all expressions are ``null``.
- SQLite, Oracle and MySQL: If any expression is ``null``, ``Greatest``
- SQLite, Oracle
,
and MySQL: If any expression is ``null``, ``Greatest``
will return ``null``.
The PostgreSQL behavior can be emulated using ``Coalesce`` if you know
a sensible minimum value to provide as a default.
Least
--------
.. versionadded:: 1.9
-----
.. class:: Least(*expressions, **extra)
.. versionadded:: 1.9
Accepts a list of at least two field names or expressions and returns the
least value. Each argument must be of a similar type, so mixing text and numbers
will result in a database error.
...
...
@@ -155,7 +155,7 @@ will result in a database error.
- PostgreSQL: ``Least`` will return the smallest non-null expression,
or ``null`` if all expressions are ``null``.
- SQLite, Oracle and MySQL: If any expression is ``null``, ``Least``
- SQLite, Oracle
,
and MySQL: If any expression is ``null``, ``Least``
will return ``null``.
The PostgreSQL behavior can be emulated using ``Coalesce`` if you know
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment