I am not able to use SoftDeleteManager with a custom queryset.
Here's what I'm attempting to do:
class CustomQuerySet(SoftDeleteQuerySet):
def unanswered(self):
return self.filter(response=None)
CustomManager = SoftDeleteManager.from_queryset(CustomQuerySet)
class Model:
...
objects = CustomManager()
When I do Model.objects.unanswered(), I get AttributeError: 'SoftDeleteQuerySet' object has no attribute 'unanswered'
It's because in SoftDeleteManager, it is overriding the queryset class to SoftDeleteQuerySet. But in my situation, I want to use my custom queryset that inherits from SoftDeleteQuerySet.
I propose only overriding the queryset class if the current queryset class is not a subclass of SoftDeleteQuerySet.
I am not able to use
SoftDeleteManager
with a custom queryset. Here's what I'm attempting to do:When I do
Model.objects.unanswered()
, I getAttributeError: 'SoftDeleteQuerySet' object has no attribute 'unanswered'
It's because inSoftDeleteManager
, it is overriding the queryset class toSoftDeleteQuerySet
. But in my situation, I want to use my custom queryset that inherits fromSoftDeleteQuerySet
.I propose only overriding the queryset class if the current queryset class is not a subclass of
SoftDeleteQuerySet
.