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
652bcc6f
Kaydet (Commit)
652bcc6f
authored
Mar 18, 2016
tarafından
Adam Chainz
Kaydeden (comit)
Tim Graham
Eyl 09, 2016
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Refs #25415 -- Fixed invalid models in the test suite.
üst
bae64dd0
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
16 additions
and
17 deletions
+16
-17
models.py
tests/expressions/models.py
+2
-2
empty_join.py
tests/foreign_object/models/empty_join.py
+1
-1
models.py
tests/introspection/models.py
+1
-1
models.py
tests/many_to_many/models.py
+0
-1
models.py
tests/model_forms/models.py
+1
-1
models.py
tests/model_formsets/models.py
+1
-1
tests.py
tests/model_formsets/tests.py
+1
-1
models.py
tests/model_meta/models.py
+2
-2
models.py
tests/ordering/models.py
+1
-1
models.py
tests/queries/models.py
+6
-6
No files found.
tests/expressions/models.py
Dosyayı görüntüle @
652bcc6f
...
...
@@ -80,8 +80,8 @@ class Time(models.Model):
@python_2_unicode_compatible
class
SimulationRun
(
models
.
Model
):
start
=
models
.
ForeignKey
(
Time
,
models
.
CASCADE
,
null
=
True
)
end
=
models
.
ForeignKey
(
Time
,
models
.
CASCADE
,
null
=
True
)
start
=
models
.
ForeignKey
(
Time
,
models
.
CASCADE
,
null
=
True
,
related_name
=
'+'
)
end
=
models
.
ForeignKey
(
Time
,
models
.
CASCADE
,
null
=
True
,
related_name
=
'+'
)
midpoint
=
models
.
TimeField
()
def
__str__
(
self
):
...
...
tests/foreign_object/models/empty_join.py
Dosyayı görüntüle @
652bcc6f
...
...
@@ -80,7 +80,7 @@ class BrokenContainsRelation(StartsWithRelation):
@python_2_unicode_compatible
class
SlugPage
(
models
.
Model
):
slug
=
models
.
CharField
(
max_length
=
20
)
slug
=
models
.
CharField
(
max_length
=
20
,
unique
=
True
)
descendants
=
StartsWithRelation
(
'self'
,
from_fields
=
[
'slug'
],
...
...
tests/introspection/models.py
Dosyayı görüntüle @
652bcc6f
...
...
@@ -45,7 +45,7 @@ class Article(models.Model):
body
=
models
.
TextField
(
default
=
''
)
reporter
=
models
.
ForeignKey
(
Reporter
,
models
.
CASCADE
)
response_to
=
models
.
ForeignKey
(
'self'
,
models
.
SET_NULL
,
null
=
True
)
unmanaged_reporters
=
models
.
ManyToManyField
(
Reporter
,
through
=
'ArticleReporter'
)
unmanaged_reporters
=
models
.
ManyToManyField
(
Reporter
,
through
=
'ArticleReporter'
,
related_name
=
'+'
)
def
__str__
(
self
):
return
self
.
headline
...
...
tests/many_to_many/models.py
Dosyayı görüntüle @
652bcc6f
...
...
@@ -51,7 +51,6 @@ class Article(models.Model):
class
AbstractArticle
(
models
.
Model
):
class
Meta
:
abstract
=
True
ordering
=
(
'title'
,)
publications
=
models
.
ManyToManyField
(
Publication
,
name
=
'publications'
,
related_name
=
'+'
)
...
...
tests/model_forms/models.py
Dosyayı görüntüle @
652bcc6f
...
...
@@ -131,7 +131,7 @@ class Author(models.Model):
class
Author1
(
models
.
Model
):
publication
=
models
.
OneToOneField
(
Publication
,
models
.
SET_NULL
,
null
=
False
)
publication
=
models
.
OneToOneField
(
Publication
,
models
.
CASCADE
,
null
=
False
)
full_name
=
models
.
CharField
(
max_length
=
255
)
...
...
tests/model_formsets/models.py
Dosyayı görüntüle @
652bcc6f
...
...
@@ -166,7 +166,7 @@ class MexicanRestaurant(Restaurant):
class
ClassyMexicanRestaurant
(
MexicanRestaurant
):
restaurant
=
models
.
OneToOneField
(
MexicanRestaurant
,
models
.
CASCADE
,
parent_link
=
True
,
primary_key
=
True
)
the_
restaurant
=
models
.
OneToOneField
(
MexicanRestaurant
,
models
.
CASCADE
,
parent_link
=
True
,
primary_key
=
True
)
tacos_are_yummy
=
models
.
BooleanField
(
default
=
False
)
...
...
tests/model_formsets/tests.py
Dosyayı görüntüle @
652bcc6f
...
...
@@ -1461,7 +1461,7 @@ class ModelFormsetTest(TestCase):
# a formset for a Model that has a custom primary key that still needs to be
# added to the formset automatically
FormSet
=
modelformset_factory
(
ClassyMexicanRestaurant
,
fields
=
[
"tacos_are_yummy"
])
self
.
assertEqual
(
sorted
(
FormSet
()
.
forms
[
0
]
.
fields
.
keys
()),
[
'
restaurant'
,
'tacos_are_yummy
'
])
self
.
assertEqual
(
sorted
(
FormSet
()
.
forms
[
0
]
.
fields
.
keys
()),
[
'
tacos_are_yummy'
,
'the_restaurant
'
])
def
test_model_formset_with_initial_model_instance
(
self
):
# has_changed should compare model instance and primary key
...
...
tests/model_meta/models.py
Dosyayı görüntüle @
652bcc6f
...
...
@@ -134,11 +134,11 @@ class CommonAncestor(models.Model):
class
FirstParent
(
CommonAncestor
):
first_ancestor
=
models
.
OneToOneField
(
CommonAncestor
,
models
.
SET_NULL
,
primary_key
=
True
,
parent_link
=
True
)
first_ancestor
=
models
.
OneToOneField
(
CommonAncestor
,
models
.
CASCADE
,
primary_key
=
True
,
parent_link
=
True
)
class
SecondParent
(
CommonAncestor
):
second_ancestor
=
models
.
OneToOneField
(
CommonAncestor
,
models
.
SET_NULL
,
primary_key
=
True
,
parent_link
=
True
)
second_ancestor
=
models
.
OneToOneField
(
CommonAncestor
,
models
.
CASCADE
,
primary_key
=
True
,
parent_link
=
True
)
class
Child
(
FirstParent
,
SecondParent
):
...
...
tests/ordering/models.py
Dosyayı görüntüle @
652bcc6f
...
...
@@ -25,7 +25,7 @@ class Author(models.Model):
@python_2_unicode_compatible
class
Article
(
models
.
Model
):
author
=
models
.
ForeignKey
(
Author
,
models
.
SET_NULL
,
null
=
True
)
second_author
=
models
.
ForeignKey
(
Author
,
models
.
SET_NULL
,
null
=
True
)
second_author
=
models
.
ForeignKey
(
Author
,
models
.
SET_NULL
,
null
=
True
,
related_name
=
'+'
)
headline
=
models
.
CharField
(
max_length
=
100
)
pub_date
=
models
.
DateTimeField
()
...
...
tests/queries/models.py
Dosyayı görüntüle @
652bcc6f
...
...
@@ -526,8 +526,8 @@ class Job(models.Model):
class
JobResponsibilities
(
models
.
Model
):
job
=
models
.
ForeignKey
(
Job
,
models
.
SET_NULL
,
to_field
=
'name'
)
responsibility
=
models
.
ForeignKey
(
'Responsibility'
,
models
.
SET_NULL
,
to_field
=
'description'
)
job
=
models
.
ForeignKey
(
Job
,
models
.
CASCADE
,
to_field
=
'name'
)
responsibility
=
models
.
ForeignKey
(
'Responsibility'
,
models
.
CASCADE
,
to_field
=
'description'
)
@python_2_unicode_compatible
...
...
@@ -620,7 +620,7 @@ class Order(models.Model):
@python_2_unicode_compatible
class
OrderItem
(
models
.
Model
):
order
=
models
.
ForeignKey
(
Order
,
models
.
SET_NULL
,
related_name
=
'items'
)
order
=
models
.
ForeignKey
(
Order
,
models
.
CASCADE
,
related_name
=
'items'
)
status
=
models
.
IntegerField
()
class
Meta
:
...
...
@@ -637,8 +637,8 @@ class BaseUser(models.Model):
@python_2_unicode_compatible
class
Task
(
models
.
Model
):
title
=
models
.
CharField
(
max_length
=
10
)
owner
=
models
.
ForeignKey
(
BaseUser
,
models
.
SET_NULL
,
related_name
=
'owner'
)
creator
=
models
.
ForeignKey
(
BaseUser
,
models
.
SET_NULL
,
related_name
=
'creator'
)
owner
=
models
.
ForeignKey
(
BaseUser
,
models
.
CASCADE
,
related_name
=
'owner'
)
creator
=
models
.
ForeignKey
(
BaseUser
,
models
.
CASCADE
,
related_name
=
'creator'
)
def
__str__
(
self
):
return
self
.
title
...
...
@@ -654,7 +654,7 @@ class Staff(models.Model):
@python_2_unicode_compatible
class
StaffUser
(
BaseUser
):
staff
=
models
.
OneToOneField
(
Staff
,
models
.
SET_NULL
,
related_name
=
'user'
)
staff
=
models
.
OneToOneField
(
Staff
,
models
.
CASCADE
,
related_name
=
'user'
)
def
__str__
(
self
):
return
self
.
staff
...
...
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