1
0
mirror of https://github.com/django/django.git synced 2025-10-26 15:16:09 +00:00

Fixed #25058 -- Added GenericRelations with related_query_name to the admin's delete confirmation page.

This commit is contained in:
sarthakmeh
2015-08-28 01:43:24 +05:30
committed by Tim Graham
parent 12083c5d47
commit 40bf18e702
4 changed files with 43 additions and 23 deletions

View File

@@ -231,12 +231,9 @@ class Collector(object):
field.remote_field.on_delete(self, field, sub_objs, self.using)
for field in model._meta.virtual_fields:
if hasattr(field, 'bulk_related_objects'):
# Its something like generic foreign key.
# It's something like generic foreign key.
sub_objs = field.bulk_related_objects(new_objs, self.using)
self.collect(sub_objs,
source=model,
source_attr=field.remote_field.related_name,
nullable=True)
self.collect(sub_objs, source=model, nullable=True)
def related_objects(self, related, objs):
"""