mirror of
https://github.com/Hopiu/django-model-utils.git
synced 2026-03-16 20:00:23 +00:00
Don't try to access __slots__ during copy()
When subclassing Django will copy managers from the ancestor class. Copying in turn calls `copy.copy()` which checks whether the object uses `__slots__` or `__dict__`. This could result in the manager calling `self.get_queryset()` before all models get registered with the ORM.
This commit is contained in:
parent
6dc8c9420f
commit
80547335c0
1 changed files with 2 additions and 1 deletions
|
|
@ -225,7 +225,8 @@ class PassThroughManagerMixin(object):
|
|||
|
||||
# pickling causes recursion errors
|
||||
_deny_methods = ['__getstate__', '__setstate__', '__getinitargs__',
|
||||
'__getnewargs__', '__copy__', '__deepcopy__', '_db']
|
||||
'__getnewargs__', '__copy__', '__deepcopy__', '_db',
|
||||
'__slots__']
|
||||
|
||||
def __init__(self, queryset_cls=None):
|
||||
self._queryset_cls = queryset_cls
|
||||
|
|
|
|||
Loading…
Reference in a new issue