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
5df3301a
Kaydet (Commit)
5df3301a
authored
Nis 24, 2019
tarafından
Mariusz Felisiak
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #30362 -- Noted partial indexes and constraints restrictions with abstract base classes.
Thanks Carlton Gibson for the review.
üst
f8f0f92e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
0 deletions
+19
-0
constraints.txt
docs/ref/models/constraints.txt
+9
-0
indexes.txt
docs/ref/models/indexes.txt
+10
-0
No files found.
docs/ref/models/constraints.txt
Dosyayı görüntüle @
5df3301a
...
@@ -19,6 +19,15 @@ option.
...
@@ -19,6 +19,15 @@ option.
convention is to use ``from django.db import models`` and refer to the
convention is to use ``from django.db import models`` and refer to the
constraints as ``models.<Foo>Constraint``.
constraints as ``models.<Foo>Constraint``.
.. admonition:: Constraints in abstract base classes
You must always specify a unique name for the constraint. As such, you
cannot normally specify a constraint on an abstract base class, since the
:attr:`Meta.constraints <django.db.models.Options.constraints>` option is
inherited by subclasses, with exactly the same values for the attributes
(including ``name``) each time. Instead, specify the ``constraints`` option
on subclasses directly, providing a unique name for each constraint.
``CheckConstraint``
``CheckConstraint``
===================
===================
...
...
docs/ref/models/indexes.txt
Dosyayı görüntüle @
5df3301a
...
@@ -49,6 +49,16 @@ The name of the index. If ``name`` isn't provided Django will auto-generate a
...
@@ -49,6 +49,16 @@ The name of the index. If ``name`` isn't provided Django will auto-generate a
name. For compatibility with different databases, index names cannot be longer
name. For compatibility with different databases, index names cannot be longer
than 30 characters and shouldn't start with a number (0-9) or underscore (_).
than 30 characters and shouldn't start with a number (0-9) or underscore (_).
.. admonition:: Partial indexes in abstract base classes
You must always specify a unique name for an index. As such, you
cannot normally specify a partial index on an abstract base class, since
the :attr:`Meta.indexes <django.db.models.Options.indexes>` option is
inherited by subclasses, with exactly the same values for the attributes
(including ``name``) each time. Instead, specify the ``indexes`` option
on subclasses directly, providing a unique name for each index.
``db_tablespace``
``db_tablespace``
-----------------
-----------------
...
...
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