initial commit
This commit is contained in:
9
core/api/mixins.py
Normal file
9
core/api/mixins.py
Normal file
@@ -0,0 +1,9 @@
|
||||
class WorkspaceQuerysetMixin:
|
||||
workspace_lookup_url_kwarg = "workspace_id"
|
||||
|
||||
def get_workspace(self):
|
||||
return self.kwargs[self.workspace_lookup_url_kwarg]
|
||||
|
||||
def get_queryset(self):
|
||||
queryset = super().get_queryset()
|
||||
return queryset.filter(workspace_id=self.get_workspace())
|
||||
Reference in New Issue
Block a user