Skip to content

Commit

Permalink
Pridan7 endpoint pre competition-type
Browse files Browse the repository at this point in the history
  • Loading branch information
kovacspe committed Dec 8, 2023
1 parent ef6ac62 commit 01fc3f5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions competition/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
router.register(r'grade', views.GradeViewSet)
router.register(r'problem-administration', views.ProblemAdministrationViewSet)
router.register(r'event-registration', views.EventRegistrationViewSet)
router.register(r'competition-type', views.CompetitionTypeViewSet)

urlpatterns = []

Expand Down
16 changes: 12 additions & 4 deletions competition/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@

from base.utils import mime_type
from competition import utils
from competition.models import (Comment, Competition, Event, EventRegistration,
Grade, LateTag, Problem, Publication,
PublicationType, Semester, Series, Solution,
Vote)
from competition.models import (Comment, Competition, CompetitionType, Event,
EventRegistration, Grade, LateTag, Problem,
Publication, PublicationType, Semester, Series,
Solution, Vote)
from competition.permissions import (CommentPermission,
CompetitionRestrictedPermission,
ProblemPermission)
from competition.serializers import (CommentSerializer, CompetitionSerializer,
CompetitionTypeSerializer,
EventRegistrationSerializer,
EventSerializer, GradeSerializer,
LateTagSerializer, ProblemSerializer,
Expand Down Expand Up @@ -118,6 +119,13 @@ def slug(self, request: Request, slug: str = None) -> Response:
)


class CompetitionTypeViewSet(mixins.RetrieveModelMixin,
mixins.ListModelMixin,
viewsets.GenericViewSet):
queryset = CompetitionType.objects.all()
serializer_class = CompetitionTypeSerializer


class CommentViewSet(
mixins.RetrieveModelMixin,
mixins.DestroyModelMixin,
Expand Down

0 comments on commit 01fc3f5

Please sign in to comment.