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
f9e5f9ae
Kaydet (Commit)
f9e5f9ae
authored
Tem 21, 2017
tarafından
Rachel Tobin
Kaydeden (comit)
Tim Graham
Tem 21, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #28418 -- Fixed queryset crash when using a GenericRelation to a proxy model.
üst
c6986a4e
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
1 deletion
+16
-1
AUTHORS
AUTHORS
+1
-0
fields.py
django/contrib/contenttypes/fields.py
+1
-1
1.11.4.txt
docs/releases/1.11.4.txt
+3
-0
models.py
tests/generic_relations_regress/models.py
+6
-0
tests.py
tests/generic_relations_regress/tests.py
+5
-0
No files found.
AUTHORS
Dosyayı görüntüle @
f9e5f9ae
...
...
@@ -646,6 +646,7 @@ answer newbie questions, and generally made Django that much better:
pradeep.gowda@gmail.com
Preston Holmes <preston@ptone.com>
Preston Timmons <prestontimmons@gmail.com>
Rachel Tobin <rmtobin@me.com>
Rachel Willmer <http://www.willmer.com/kb/>
Radek Švarz <http://www.svarz.cz/translate/>
Rajesh Dhawan <rajesh.dhawan@gmail.com>
...
...
django/contrib/contenttypes/fields.py
Dosyayı görüntüle @
f9e5f9ae
...
...
@@ -362,7 +362,7 @@ class GenericRelation(ForeignObject):
# generating a join to the parent model, then generating joins to the
# child models.
path
=
[]
opts
=
self
.
remote_field
.
model
.
_meta
opts
=
self
.
remote_field
.
model
.
_meta
.
concrete_model
.
_meta
parent_opts
=
opts
.
get_field
(
self
.
object_id_field_name
)
.
model
.
_meta
target
=
parent_opts
.
pk
path
.
append
(
PathInfo
(
self
.
model
.
_meta
,
parent_opts
,
(
target
,),
self
.
remote_field
,
True
,
False
))
...
...
docs/releases/1.11.4.txt
Dosyayı görüntüle @
f9e5f9ae
...
...
@@ -35,3 +35,6 @@ Bugfixes
``checkbox_name``, ``checkbox_id``, ``is_initial``, ``input_text``,
``initial_text``, and ``clear_checkbox_label`` are now attributes of
``widget`` rather than appearing in the top-level context.
* Fixed queryset crash when using a ``GenericRelation`` to a proxy model
(:ticket:`28418`).
tests/generic_relations_regress/models.py
Dosyayı görüntüle @
f9e5f9ae
...
...
@@ -19,9 +19,15 @@ class Link(models.Model):
return
"Link to
%
s id=
%
s"
%
(
self
.
content_type
,
self
.
object_id
)
class
LinkProxy
(
Link
):
class
Meta
:
proxy
=
True
class
Place
(
models
.
Model
):
name
=
models
.
CharField
(
max_length
=
100
)
links
=
GenericRelation
(
Link
)
link_proxy
=
GenericRelation
(
LinkProxy
)
def
__str__
(
self
):
return
"Place:
%
s"
%
self
.
name
...
...
tests/generic_relations_regress/tests.py
Dosyayı görüntüle @
f9e5f9ae
...
...
@@ -246,3 +246,8 @@ class GenericRelationTests(TestCase):
def
test_ticket_22982
(
self
):
place
=
Place
.
objects
.
create
(
name
=
'My Place'
)
self
.
assertIn
(
'GenericRelatedObjectManager'
,
str
(
place
.
links
))
def
test_filter_on_related_proxy_model
(
self
):
place
=
Place
.
objects
.
create
()
Link
.
objects
.
create
(
content_object
=
place
)
self
.
assertEqual
(
Place
.
objects
.
get
(
link_proxy__object_id
=
place
.
id
),
place
)
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