c3lf-system-3/core/mail/api_v2.py
2024-01-07 17:50:12 +01:00

22 lines
506 B
Python

from rest_framework import routers, viewsets, serializers
from mail.models import Email
class EmailSerializer(serializers.ModelSerializer):
class Meta:
model = Email
fields = '__all__'
class EmailViewSet(viewsets.ModelViewSet):
serializer_class = EmailSerializer
queryset = Email.objects.all()
permission_classes = []
authentication_classes = []
router = routers.SimpleRouter()
router.register(r'mails', EmailViewSet, basename='mails')
urlpatterns = router.urls