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
db613f4f
Kaydet (Commit)
db613f4f
authored
Haz 15, 2016
tarafından
Sergey Fedoseev
Kaydeden (comit)
Tim Graham
Haz 15, 2016
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Refs #14030 -- Updated docs per "Improved expression support for python values."
Complements
e2d6e146
.
üst
abec15ad
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
conditional-expressions.txt
docs/ref/models/conditional-expressions.txt
+2
-3
No files found.
docs/ref/models/conditional-expressions.txt
Dosyayı görüntüle @
db613f4f
...
@@ -70,7 +70,6 @@ Keep in mind that each of these values can be an expression.
...
@@ -70,7 +70,6 @@ Keep in mind that each of these values can be an expression.
:class:`~django.db.models.Model` has a field named ``then``. This can be
:class:`~django.db.models.Model` has a field named ``then``. This can be
resolved in two ways::
resolved in two ways::
>>> from django.db.models import Value
>>> When(then__exact=0, then=1)
>>> When(then__exact=0, then=1)
>>> When(Q(then=0), then=1)
>>> When(Q(then=0), then=1)
...
@@ -116,8 +115,8 @@ A simple example::
...
@@ -116,8 +115,8 @@ A simple example::
``Case()`` accepts any number of ``When()`` objects as individual arguments.
``Case()`` accepts any number of ``When()`` objects as individual arguments.
Other options are provided using keyword arguments. If none of the conditions
Other options are provided using keyword arguments. If none of the conditions
evaluate to ``TRUE``, then the expression given with the ``default`` keyword
evaluate to ``TRUE``, then the expression given with the ``default`` keyword
argument is returned. If
no ``default`` argument is provided, ``Value(None)``
argument is returned. If
a ``default`` argument isn't provided, ``None`` is
is
used.
used.
If we wanted to change our previous query to get the discount based on how long
If we wanted to change our previous query to get the discount based on how long
the ``Client`` has been with us, we could do so using lookups::
the ``Client`` has been with us, we could do so using lookups::
...
...
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