eadwinCode/django-ninja-extra

ModelServiceBase should allow default filtering base on the Request

Opened this issue · 0 comments

Description:

Currently, the ModelServiceBase class in Django Ninja Extra does not provide a built-in mechanism for applying default filters to querysets based on the incoming Request. This feature is essential for scenarios where data needs to be scoped to the requesting user, such as in multi-tenant applications where each user should only access data associated with their account

Proposed Enhancement:

I propose adding a method or a mechanism within ModelServiceBase that allows developers to define default filters that will be applied to the queryset based on the Request object. This would simplify the process of ensuring data separation and make it easier to implement consistent filtering logic across different services.