OwnerMixinManager parameters causes ManyToMany mappings to fail
I am new to Python and Django, so please forgive me if I'm wrong here.
this bug fully describes what I've encountered with models which use the SingleOwnerMixin or MultipleOwnerMixin classes, when trying to access related records. it doesn't appear to have been resolved.
My workaround is to create two manager classes, basically duplicating the existing manager class and modifying the init function of each to remove the extra parameter, e.g.
class SingleOwnerMixinManager(models.Manager): ... def __init__(self): super(SingleOwnerMixinManager, self).__init__() self.__owner_filter = 'owner'
class MultipleOwnerMixinManager(models.Manager): ... def __init__(self): super(MultipleOwnerMixinManager, self).__init__() self.__owner_filter = 'owners'
and then for each Mixin to use the appropriate manager, e.g.
class SingleOwnerMixin(OwnerMixinBase): ... objects = SingleOwnerMixinManager()
class MultipleOwnerMixin(OwnerMixinBase): ... objects = MultipleOwnerMixinManager()