1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #3871 -- Fixed regression introduced by 04a2a6b.

Added do_not_call_in_templates=True attribute to RelatedManagers
to prevent them from being called.

Thanks jbg@ for the report.
This commit is contained in:
Loic Bistuer
2013-09-30 10:21:21 +07:00
committed by Tim Graham
parent 4745ea1d27
commit d847ddfe1d
4 changed files with 49 additions and 2 deletions

View File

@@ -335,6 +335,7 @@ def create_generic_related_manager(superclass):
object_id_field_name = self.object_id_field_name,
prefetch_cache_name = self.prefetch_cache_name,
)
do_not_call_in_templates = True
def get_queryset(self):
try:

View File

@@ -377,6 +377,7 @@ def create_foreign_related_manager(superclass, rel_field, rel_model):
manager = getattr(self.model, kwargs.pop('manager'))
manager_class = create_foreign_related_manager(manager.__class__, rel_field, rel_model)
return manager_class(self.instance)
do_not_call_in_templates = True
def get_queryset(self):
try:
@@ -545,6 +546,7 @@ def create_many_related_manager(superclass, rel):
through=self.through,
prefetch_cache_name=self.prefetch_cache_name,
)
do_not_call_in_templates = True
def get_queryset(self):
try: