-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The Team API is needed as a publicly readable entity because the posi…
…tions and the team descriptions are open to the public. If a new team is created or edited, it will most likely be through the admin console, meaning that we probably shouldn't have writeable APIs for this. Ludwig I'm writing this in a commit to show you that we need a ticketing system. In most ticketing systems you can set up an automation where referencing the ticket number will associate your commit to that ticket.
- Loading branch information
Showing
5 changed files
with
26 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from involvement.models.team import Team | ||
from rest_framework import serializers | ||
|
||
#Serializer for team | ||
class TeamSerializer(serializers.ModelSerializer): | ||
class Meta: | ||
model = Team | ||
fields = '__all__' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from rest_framework import viewsets | ||
from involvement.serializers.team_serializer import TeamSerializer | ||
from rest_framework.permissions import AllowAny | ||
from involvement.models.team import Team | ||
|
||
#Read Teams API | ||
class TeamViewSet(viewsets.ReadOnlyModelViewSet): | ||
serializer_class = TeamSerializer | ||
permission_classes = [AllowAny] | ||
queryset = Team.objects.all() | ||
|