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
11d9cbe2
Kaydet (Commit)
11d9cbe2
authored
Agu 19, 2014
tarafından
Lee Sanghyuck
Kaydeden (comit)
Tim Graham
Agu 19, 2014
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #23316 -- Added datetime.time serialization in migrations.
üst
ad9ba9d2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
1 deletion
+7
-1
AUTHORS
AUTHORS
+1
-0
writer.py
django/db/migrations/writer.py
+4
-0
migrations.txt
docs/topics/migrations.txt
+1
-1
test_writer.py
tests/migrations/test_writer.py
+1
-0
No files found.
AUTHORS
Dosyayı görüntüle @
11d9cbe2
...
@@ -545,6 +545,7 @@ answer newbie questions, and generally made Django that much better:
...
@@ -545,6 +545,7 @@ answer newbie questions, and generally made Django that much better:
Bartolome Sanchez Salado <i42sasab@uco.es>
Bartolome Sanchez Salado <i42sasab@uco.es>
Nick Sandford <nick.sandford@gmail.com>
Nick Sandford <nick.sandford@gmail.com>
Mark Sandstrom <mark@deliciouslynerdy.com>
Mark Sandstrom <mark@deliciouslynerdy.com>
Lee Sanghyuck <shlee322@elab.kr>
Kadesarin Sanjek
Kadesarin Sanjek
Tim Saylor <tim.saylor@gmail.com>
Tim Saylor <tim.saylor@gmail.com>
Massimo Scamarcia <massimo.scamarcia@gmail.com>
Massimo Scamarcia <massimo.scamarcia@gmail.com>
...
...
django/db/migrations/writer.py
Dosyayı görüntüle @
11d9cbe2
...
@@ -279,6 +279,10 @@ class MigrationWriter(object):
...
@@ -279,6 +279,10 @@ class MigrationWriter(object):
if
isinstance
(
value
,
datetime_safe
.
date
):
if
isinstance
(
value
,
datetime_safe
.
date
):
value_repr
=
"datetime.
%
s"
%
value_repr
value_repr
=
"datetime.
%
s"
%
value_repr
return
value_repr
,
set
([
"import datetime"
])
return
value_repr
,
set
([
"import datetime"
])
# Times
elif
isinstance
(
value
,
datetime
.
time
):
value_repr
=
repr
(
value
)
return
value_repr
,
set
([
"import datetime"
])
# Settings references
# Settings references
elif
isinstance
(
value
,
SettingsReference
):
elif
isinstance
(
value
,
SettingsReference
):
return
"settings.
%
s"
%
value
.
setting_name
,
set
([
"from django.conf import settings"
])
return
"settings.
%
s"
%
value
.
setting_name
,
set
([
"from django.conf import settings"
])
...
...
docs/topics/migrations.txt
Dosyayı görüntüle @
11d9cbe2
...
@@ -524,7 +524,7 @@ Django can serialize the following:
...
@@ -524,7 +524,7 @@ Django can serialize the following:
- ``int``, ``long``, ``float``, ``bool``, ``str``, ``unicode``, ``bytes``, ``None``
- ``int``, ``long``, ``float``, ``bool``, ``str``, ``unicode``, ``bytes``, ``None``
- ``list``, ``set``, ``tuple``, ``dict``
- ``list``, ``set``, ``tuple``, ``dict``
- ``datetime.date`` and ``datetime.datetime`` instances
- ``datetime.date``
, ``datetime.time``,
and ``datetime.datetime`` instances
- ``decimal.Decimal`` instances
- ``decimal.Decimal`` instances
- Any Django field
- Any Django field
- Any function or method reference (e.g. ``datetime.datetime.today``)
- Any function or method reference (e.g. ``datetime.datetime.today``)
...
...
tests/migrations/test_writer.py
Dosyayı görüntüle @
11d9cbe2
...
@@ -95,6 +95,7 @@ class WriterTests(TestCase):
...
@@ -95,6 +95,7 @@ class WriterTests(TestCase):
self
.
assertSerializedEqual
(
datetime
.
datetime
.
today
)
self
.
assertSerializedEqual
(
datetime
.
datetime
.
today
)
self
.
assertSerializedEqual
(
datetime
.
date
.
today
())
self
.
assertSerializedEqual
(
datetime
.
date
.
today
())
self
.
assertSerializedEqual
(
datetime
.
date
.
today
)
self
.
assertSerializedEqual
(
datetime
.
date
.
today
)
self
.
assertSerializedEqual
(
datetime
.
datetime
.
now
()
.
time
())
with
self
.
assertRaises
(
ValueError
):
with
self
.
assertRaises
(
ValueError
):
self
.
assertSerializedEqual
(
datetime
.
datetime
(
2012
,
1
,
1
,
1
,
1
,
tzinfo
=
get_default_timezone
()))
self
.
assertSerializedEqual
(
datetime
.
datetime
(
2012
,
1
,
1
,
1
,
1
,
tzinfo
=
get_default_timezone
()))
safe_date
=
datetime_safe
.
date
(
2014
,
3
,
31
)
safe_date
=
datetime_safe
.
date
(
2014
,
3
,
31
)
...
...
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