mirror of
https://github.com/Eugeny/tabby-web.git
synced 2026-08-18 07:16:03 +01: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)
|