From f676305ecede116332884ea682fc953c29813232 Mon Sep 17 00:00:00 2001 From: Jacob Haslehurst Date: Thu, 7 Aug 2014 16:06:44 +1000 Subject: Fixed #22982 -- Added GenericRelatedObjectManager.__str__. to prevent crash. Thanks bendavis78 for the report. Forwardport of 29585e9b6a from stable/1.7.x --- django/contrib/contenttypes/fields.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'django') diff --git a/django/contrib/contenttypes/fields.py b/django/contrib/contenttypes/fields.py index 3c3b4d0039..5620d735fc 100644 --- a/django/contrib/contenttypes/fields.py +++ b/django/contrib/contenttypes/fields.py @@ -457,6 +457,9 @@ def create_generic_related_manager(superclass): ) do_not_call_in_templates = True + def __str__(self): + return repr(self) + def get_queryset(self): try: return self.instance._prefetched_objects_cache[self.prefetch_cache_name] -- cgit v1.3