mirror of
https://github.com/django/django.git
synced 2025-10-30 09:06:13 +00:00
[1.8.x] Fixed #24831 -- Fixed pickling queryset with prefetch_related() after deleting objects.
Backport of 2913d6b77d from master
This commit is contained in:
committed by
Tim Graham
parent
1c57d7e7fa
commit
9d83de8ff3
@@ -1407,6 +1407,11 @@ class ManyToOneRel(ForeignObjectRel):
|
||||
parent_link=parent_link, on_delete=on_delete, related_query_name=related_query_name)
|
||||
self.field_name = field_name
|
||||
|
||||
def __getstate__(self):
|
||||
state = self.__dict__.copy()
|
||||
state.pop('related_model', None)
|
||||
return state
|
||||
|
||||
def get_related_field(self):
|
||||
"""
|
||||
Returns the Field in the 'to' object to which this relationship is
|
||||
|
||||
Reference in New Issue
Block a user