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
cee4fe73
Kaydet (Commit)
cee4fe73
authored
Ara 11, 2013
tarafından
Andrew Godwin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Better default name for migrations we can't give nice names to
üst
248fdb11
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
autodetector.py
django/db/migrations/autodetector.py
+5
-3
No files found.
django/db/migrations/autodetector.py
Dosyayı görüntüle @
cee4fe73
import
re
import
datetime
from
django.db.migrations
import
operations
from
django.db.migrations.migration
import
Migration
...
...
@@ -350,8 +351,9 @@ class MigrationAutodetector(object):
def
suggest_name
(
cls
,
ops
):
"""
Given a set of operations, suggests a name for the migration
they might represent. Names not guaranteed to be unique; they
must be prefixed by a number or date.
they might represent. Names are not guaranteed to be unique,
but we put some effort in to the fallback name to avoid VCS conflicts
if we can.
"""
if
len
(
ops
)
==
1
:
if
isinstance
(
ops
[
0
],
operations
.
CreateModel
):
...
...
@@ -364,7 +366,7 @@ class MigrationAutodetector(object):
return
"remove_
%
s_
%
s"
%
(
ops
[
0
]
.
model_name
.
lower
(),
ops
[
0
]
.
name
.
lower
())
elif
all
(
isinstance
(
o
,
operations
.
CreateModel
)
for
o
in
ops
):
return
"_"
.
join
(
sorted
(
o
.
name
.
lower
()
for
o
in
ops
))
return
"auto
"
return
"auto
_
%
s"
%
datetime
.
datetime
.
now
()
.
strftime
(
"
%
Y
%
m
%
d_
%
H
%
M"
)
@classmethod
def
parse_number
(
cls
,
name
):
...
...
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