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
a035d9d6
Kaydet (Commit)
a035d9d6
authored
Haz 08, 2012
tarafından
Anssi Kääriäinen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Cleaned whitespace errors introduced in previous commit
üst
b6d533af
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
16 deletions
+16
-16
tests.py
django/contrib/contenttypes/tests.py
+4
-4
contenttypes.txt
docs/ref/contrib/contenttypes.txt
+8
-8
1.5.txt
docs/releases/1.5.txt
+4
-4
No files found.
django/contrib/contenttypes/tests.py
Dosyayı görüntüle @
a035d9d6
...
@@ -151,14 +151,14 @@ class ContentTypesTests(TestCase):
...
@@ -151,14 +151,14 @@ class ContentTypesTests(TestCase):
self
.
assertEqual
(
concrete_model_ct
,
self
.
assertEqual
(
concrete_model_ct
,
ContentType
.
objects
.
get_for_model
(
DeferredConcreteModel
,
ContentType
.
objects
.
get_for_model
(
DeferredConcreteModel
,
for_concrete_model
=
False
))
for_concrete_model
=
False
))
self
.
assertEqual
(
concrete_model_ct
,
self
.
assertEqual
(
concrete_model_ct
,
ContentType
.
objects
.
get_for_model
(
DeferredProxyModel
))
ContentType
.
objects
.
get_for_model
(
DeferredProxyModel
))
self
.
assertEqual
(
proxy_model_ct
,
self
.
assertEqual
(
proxy_model_ct
,
ContentType
.
objects
.
get_for_model
(
DeferredProxyModel
,
ContentType
.
objects
.
get_for_model
(
DeferredProxyModel
,
for_concrete_model
=
False
))
for_concrete_model
=
False
))
def
test_get_for_concrete_models
(
self
):
def
test_get_for_concrete_models
(
self
):
"""
"""
Make sure the `for_concrete_models` kwarg correctly works
Make sure the `for_concrete_models` kwarg correctly works
...
@@ -185,7 +185,7 @@ class ContentTypesTests(TestCase):
...
@@ -185,7 +185,7 @@ class ContentTypesTests(TestCase):
ConcreteModel
.
objects
.
create
(
name
=
"Concrete"
)
ConcreteModel
.
objects
.
create
(
name
=
"Concrete"
)
DeferredConcreteModel
=
ConcreteModel
.
objects
.
only
(
'pk'
)
.
get
()
.
__class__
DeferredConcreteModel
=
ConcreteModel
.
objects
.
only
(
'pk'
)
.
get
()
.
__class__
DeferredProxyModel
=
ProxyModel
.
objects
.
only
(
'pk'
)
.
get
()
.
__class__
DeferredProxyModel
=
ProxyModel
.
objects
.
only
(
'pk'
)
.
get
()
.
__class__
cts
=
ContentType
.
objects
.
get_for_models
(
DeferredConcreteModel
,
cts
=
ContentType
.
objects
.
get_for_models
(
DeferredConcreteModel
,
DeferredProxyModel
)
DeferredProxyModel
)
self
.
assertEqual
(
cts
,
{
self
.
assertEqual
(
cts
,
{
...
@@ -200,7 +200,7 @@ class ContentTypesTests(TestCase):
...
@@ -200,7 +200,7 @@ class ContentTypesTests(TestCase):
DeferredConcreteModel
:
concrete_model_ct
,
DeferredConcreteModel
:
concrete_model_ct
,
DeferredProxyModel
:
proxy_model_ct
,
DeferredProxyModel
:
proxy_model_ct
,
})
})
def
test_shortcut_view
(
self
):
def
test_shortcut_view
(
self
):
"""
"""
...
...
docs/ref/contrib/contenttypes.txt
Dosyayı görüntüle @
a035d9d6
...
@@ -226,15 +226,15 @@ lookup::
...
@@ -226,15 +226,15 @@ lookup::
.. versionadded:: 1.5
.. versionadded:: 1.5
Prior to Django 1.5 :meth:`~ContentTypeManager.get_for_model()` and
Prior to Django 1.5 :meth:`~ContentTypeManager.get_for_model()` and
:meth:`~ContentTypeManager.get_for_models()` always returned the
:meth:`~ContentTypeManager.get_for_models()` always returned the
:class:`~django.contrib.contenttypes.models.ContentType` associated with the
:class:`~django.contrib.contenttypes.models.ContentType` associated with the
concrete model of the specified one(s). That means there was no way to retreive
concrete model of the specified one(s). That means there was no way to retreive
the :class:`~django.contrib.contenttypes.models.ContentType` of a proxy model
the :class:`~django.contrib.contenttypes.models.ContentType` of a proxy model
using those methods. As of Django 1.5 you can now pass a boolean flag –
using those methods. As of Django 1.5 you can now pass a boolean flag –
respectively ``for_concrete_model`` and ``for_concrete_models`` – to specify
respectively ``for_concrete_model`` and ``for_concrete_models`` – to specify
wether or not you want to retreive the
wether or not you want to retreive the
:class:`~django.contrib.contenttypes.models.ContentType` for the concrete or
:class:`~django.contrib.contenttypes.models.ContentType` for the concrete or
direct model.
direct model.
Generic relations
Generic relations
...
...
docs/releases/1.5.txt
Dosyayı görüntüle @
a035d9d6
...
@@ -72,11 +72,11 @@ tag's content.
...
@@ -72,11 +72,11 @@ tag's content.
Retreival of ``ContentType`` instances associated with proxy models
Retreival of ``ContentType`` instances associated with proxy models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The methods :meth:`ContentTypeManager.get_for_model() <django.contrib.contenttypes.models.ContentTypeManager.get_for_model()>`
The methods :meth:`ContentTypeManager.get_for_model() <django.contrib.contenttypes.models.ContentTypeManager.get_for_model()>`
and :meth:`ContentTypeManager.get_for_models() <django.contrib.contenttypes.models.ContentTypeManager.get_for_models()>`
and :meth:`ContentTypeManager.get_for_models() <django.contrib.contenttypes.models.ContentTypeManager.get_for_models()>`
have a new keyword argument – respectively ``for_concrete_model`` and ``for_concrete_models``.
have a new keyword argument – respectively ``for_concrete_model`` and ``for_concrete_models``.
By passing ``False`` using this argument it is now possible to retreive the
By passing ``False`` using this argument it is now possible to retreive the
:class:`ContentType <django.contrib.contenttypes.models.ContentType>`
:class:`ContentType <django.contrib.contenttypes.models.ContentType>`
associated with proxy models.
associated with proxy models.
Minor features
Minor features
...
...
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