-
-
Notifications
You must be signed in to change notification settings - Fork 46
Open
Description
def get_one(self, pk: t.Any, **kwargs: t.Any) -> t.Any:
obj = get_object_or_exception(
klass=self.model, error_message=None, exception=NotFound, pk=pk
)
return obj
so you can't provide custom queryset to klass with deep inheritance adding chains more chains because it doesn't accept it from the kwargs. Similar with the other attrs used. What if it would be like
def get_one(self, pk: t.Any, **kwargs: t.Any) -> t.Any:
obj = get_object_or_exception(
klass=kwargs.get("klass") or self.model,
error_message=kwargs.get("error_message"),
exception=kwargs.get("exception") or NotFound,
pk=pk
)
return obj
or something like that. Also it seems that klass would be better to limit to only accept QuerySet but I didn't research much.
Metadata
Metadata
Assignees
Labels
No labels