citusdata / citusdata/django-multitenant

Issue with using TenantModel in DjangoRestFramework viewsets

Open
#7 4 comments 9 reactions 0 assignees View on GitHub
tips & tricks view integration
Dominant language
Python
Stars
823
Forks
126
PR merge metrics
No merged PRs in 30d

Description

To use TenantModel with Django Rest Framework's ViewSets, the following refactor was necessary:
```python
# before
class MyModelViewSet(GenericViewSet):
queryset = MyModel.objects.all()
```
```python
# after
class MyModelViewSet(GenericViewSet):
def get_queryset(self):
return MyModel.objects.all()
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.