mirror of
https://github.com/Eugeny/tabby-web.git
synced 2026-08-18 07:16:03 +01:00
wip
This commit is contained in:
19
terminus/app/api.py
Normal file
19
terminus/app/api.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# 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)
|
||||
Reference in New Issue
Block a user