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
d95f1e71
Kaydet (Commit)
d95f1e71
authored
Ara 05, 2017
tarafından
Nick Pope
Kaydeden (comit)
Tim Graham
Ock 09, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Allowed indexes in contrib.postgres to have suffixes of any length.
üst
09530e61
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
9 deletions
+13
-9
indexes.py
django/contrib/postgres/indexes.py
+13
-9
No files found.
django/contrib/postgres/indexes.py
Dosyayı görüntüle @
d95f1e71
from
django.db.models
import
Index
from
django.utils.functional
import
cached_property
__all__
=
[
'BrinIndex'
,
'GinIndex'
,
'GistIndex'
]
class
MaxLengthMixin
:
# Allow an index name longer than 30 characters since the suffix is 4
# characters (usual limit is 3). Since this index can only be used on
# PostgreSQL, the 30 character limit for cross-database compatibility isn't
# applicable.
max_name_length
=
31
class
PostgresIndex
(
Index
):
@cached_property
def
max_name_length
(
self
):
# Allow an index name longer than 30 characters when the suffix is
# longer than the usual 3 character limit. The 30 character limit for
# cross-database compatibility isn't applicable to PostgreSQL-specific
# indexes.
return
Index
.
max_name_length
-
len
(
Index
.
suffix
)
+
len
(
self
.
suffix
)
class
BrinIndex
(
MaxLengthMixin
,
Index
):
class
BrinIndex
(
PostgresIndex
):
suffix
=
'brin'
def
__init__
(
self
,
*
,
pages_per_range
=
None
,
**
kwargs
):
...
...
@@ -35,7 +39,7 @@ class BrinIndex(MaxLengthMixin, Index):
return
statement
class
GinIndex
(
Index
):
class
GinIndex
(
Postgres
Index
):
suffix
=
'gin'
def
__init__
(
self
,
*
,
fastupdate
=
None
,
gin_pending_list_limit
=
None
,
**
kwargs
):
...
...
@@ -63,7 +67,7 @@ class GinIndex(Index):
return
statement
class
GistIndex
(
MaxLengthMixin
,
Index
):
class
GistIndex
(
Postgres
Index
):
suffix
=
'gist'
def
__init__
(
self
,
*
,
buffering
=
None
,
fillfactor
=
None
,
**
kwargs
):
...
...
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