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
3a4558b8
Kaydet (Commit)
3a4558b8
authored
Ara 10, 2018
tarafından
Manan
Kaydeden (comit)
Tim Graham
Ara 10, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Moved choices inside of test models per coding style.
üst
f0082b9a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
34 deletions
+27
-34
models.py
tests/admin_views/models.py
+9
-12
models.py
tests/choices/models.py
+4
-5
models.py
tests/model_forms/models.py
+10
-12
models.py
tests/update_only_fields/models.py
+4
-5
No files found.
tests/admin_views/models.py
Dosyayı görüntüle @
3a4558b8
...
...
@@ -632,19 +632,16 @@ class Reservation(models.Model):
price
=
models
.
IntegerField
()
DRIVER_CHOICES
=
(
(
'bill'
,
'Bill G'
),
(
'steve'
,
'Steve J'
),
)
RESTAURANT_CHOICES
=
(
(
'indian'
,
'A Taste of India'
),
(
'thai'
,
'Thai Pography'
),
(
'pizza'
,
'Pizza Mama'
),
)
class
FoodDelivery
(
models
.
Model
):
DRIVER_CHOICES
=
(
(
'bill'
,
'Bill G'
),
(
'steve'
,
'Steve J'
),
)
RESTAURANT_CHOICES
=
(
(
'indian'
,
'A Taste of India'
),
(
'thai'
,
'Thai Pography'
),
(
'pizza'
,
'Pizza Mama'
),
)
reference
=
models
.
CharField
(
max_length
=
100
)
driver
=
models
.
CharField
(
max_length
=
100
,
choices
=
DRIVER_CHOICES
,
blank
=
True
)
restaurant
=
models
.
CharField
(
max_length
=
100
,
choices
=
RESTAURANT_CHOICES
,
blank
=
True
)
...
...
tests/choices/models.py
Dosyayı görüntüle @
3a4558b8
...
...
@@ -11,13 +11,12 @@ field. This method returns the "human-readable" value of the field.
from
django.db
import
models
GENDER_CHOICES
=
(
(
'M'
,
'Male'
),
(
'F'
,
'Female'
),
)
class
Person
(
models
.
Model
):
GENDER_CHOICES
=
(
(
'M'
,
'Male'
),
(
'F'
,
'Female'
),
)
name
=
models
.
CharField
(
max_length
=
20
)
gender
=
models
.
CharField
(
max_length
=
1
,
choices
=
GENDER_CHOICES
)
...
...
tests/model_forms/models.py
Dosyayı görüntüle @
3a4558b8
...
...
@@ -11,18 +11,6 @@ from django.db import models
temp_storage_dir
=
tempfile
.
mkdtemp
()
temp_storage
=
FileSystemStorage
(
temp_storage_dir
)
ARTICLE_STATUS
=
(
(
1
,
'Draft'
),
(
2
,
'Pending'
),
(
3
,
'Live'
),
)
ARTICLE_STATUS_CHAR
=
(
(
'd'
,
'Draft'
),
(
'p'
,
'Pending'
),
(
'l'
,
'Live'
),
)
class
Person
(
models
.
Model
):
name
=
models
.
CharField
(
max_length
=
100
)
...
...
@@ -51,6 +39,11 @@ class Writer(models.Model):
class
Article
(
models
.
Model
):
ARTICLE_STATUS
=
(
(
1
,
'Draft'
),
(
2
,
'Pending'
),
(
3
,
'Live'
),
)
headline
=
models
.
CharField
(
max_length
=
50
)
slug
=
models
.
SlugField
()
pub_date
=
models
.
DateField
()
...
...
@@ -239,6 +232,11 @@ class Triple(models.Model):
class
ArticleStatus
(
models
.
Model
):
ARTICLE_STATUS_CHAR
=
(
(
'd'
,
'Draft'
),
(
'p'
,
'Pending'
),
(
'l'
,
'Live'
),
)
status
=
models
.
CharField
(
max_length
=
2
,
choices
=
ARTICLE_STATUS_CHAR
,
blank
=
True
,
null
=
True
)
...
...
tests/update_only_fields/models.py
Dosyayı görüntüle @
3a4558b8
from
django.db
import
models
GENDER_CHOICES
=
(
(
'M'
,
'Male'
),
(
'F'
,
'Female'
),
)
class
Account
(
models
.
Model
):
num
=
models
.
IntegerField
()
class
Person
(
models
.
Model
):
GENDER_CHOICES
=
(
(
'M'
,
'Male'
),
(
'F'
,
'Female'
),
)
name
=
models
.
CharField
(
max_length
=
20
)
gender
=
models
.
CharField
(
max_length
=
1
,
choices
=
GENDER_CHOICES
)
pid
=
models
.
IntegerField
(
null
=
True
,
default
=
None
)
...
...
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