23 lines
612 B
Python
23 lines
612 B
Python
from rest_framework import routers, viewsets, serializers
|
|
|
|
from tickets.models import IssueThread
|
|
from notify_sessions.models import SystemEvent
|
|
|
|
|
|
class SystemEventSerializer(serializers.ModelSerializer):
|
|
class Meta:
|
|
model = SystemEvent
|
|
fields = '__all__'
|
|
|
|
|
|
class SystemEventViewSet(viewsets.ModelViewSet):
|
|
serializer_class = SystemEventSerializer
|
|
queryset = SystemEvent.objects.all()
|
|
permission_classes = []
|
|
authentication_classes = []
|
|
|
|
|
|
router = routers.SimpleRouter()
|
|
router.register(r'systemevents', SystemEventViewSet, basename='systemevents')
|
|
|
|
urlpatterns = router.urls
|