22 lines
530 B
Python
22 lines
530 B
Python
from rest_framework import routers, viewsets, serializers
|
|
|
|
from tickets.models import IssueThread
|
|
|
|
|
|
class IssueSerializer(serializers.ModelSerializer):
|
|
class Meta:
|
|
model = IssueThread
|
|
fields = '__all__'
|
|
|
|
|
|
class IssueViewSet(viewsets.ModelViewSet):
|
|
serializer_class = IssueSerializer
|
|
queryset = IssueThread.objects.all()
|
|
permission_classes = []
|
|
authentication_classes = []
|
|
|
|
|
|
router = routers.SimpleRouter()
|
|
router.register(r'tickets', IssueViewSet, basename='issues')
|
|
|
|
urlpatterns = router.urls
|