mirror of
https://github.com/Eugeny/tabby-web.git
synced 2025-06-10 14:39:53 +00:00
20 lines
480 B
Python
20 lines
480 B
Python
# from rest_framework import fields
|
|
from rest_framework.viewsets import ModelViewSet
|
|
from rest_framework.serializers import ModelSerializer
|
|
|
|
from .models import Config
|
|
|
|
|
|
class ConfigSerializer(ModelSerializer):
|
|
class Meta:
|
|
model = Config
|
|
fields = '__all__'
|
|
|
|
|
|
class ConfigViewSet(ModelViewSet):
|
|
queryset = Config.objects.all()
|
|
serializer_class = ConfigSerializer
|
|
|
|
def get_queryset(self):
|
|
return Config.objects.filter(user=self.request.user)
|