-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API:s for the new front-end #792
Open
ankurr0y
wants to merge
22
commits into
development
Choose a base branch
from
ankur-dev
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 6 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
3fbce30
API and serializers for position
ankurr0y f9fe3e7
Merge branch 'development' of https://github.com/UTNkar/moore into an…
ankurr0y 8c81501
Event API
ankurr0y 3db3b56
Minor change in URL
ankurr0y a61ab36
Adding fields
ankurr0y 4645bde
Depth
ankurr0y 8d6dd91
Merge branch 'development' of https://github.com/UTNkar/moore into an…
ankurr0y 26cc620
Changed to authenticated or readonly
ankurr0y a82dbf1
Permissions 1
ankurr0y 6212353
The Team API is needed as a publicly readable entity because the posi…
ankurr0y 182194b
Adding Role ReadOnly
ankurr0y e83e501
Minor change
ankurr0y f370981
Read APIs for Applications
ankurr0y d8b8234
Creation, Deletion and Update of Application implemented, it only wor…
ankurr0y df3d09a
API for event application for own events
ankurr0y 3c1a7e6
Tickets done
ankurr0y ce1de7d
Small commit to extend events API
ankurr0y 1f116ea
CSRF and Me API
ankurr0y 1dc7b6f
CSRF fixed
ankurr0y 7d12bd1
Most APIs
ankurr0y 2be8a89
Added URLs
ankurr0y aee9851
Final API
ankurr0y File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Empty file.
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,31 @@ | ||
from events.models.costs import Costs | ||
from events.models.event import Event | ||
from events.models.participant import Participant | ||
from events.models.application import EventApplication | ||
from events.models.ticket import Ticket | ||
from rest_framework import serializers | ||
|
||
class CostsSerializer(serializers.ModelSerializer): | ||
class Meta: | ||
model = Costs | ||
fields = '__all__' | ||
|
||
class EventSerializer(serializers.ModelSerializer): | ||
class Meta: | ||
model = Event | ||
fields = '__all__' | ||
|
||
class ParticipantSerializer(serializers.ModelSerializer): | ||
class Meta: | ||
model = Participant | ||
fields = '__all__' | ||
|
||
class EventApplicationSerializer(serializers.ModelSerializer): | ||
class Meta: | ||
model = EventApplication | ||
fields = '__all__' | ||
|
||
class TicketSerializer(serializers.ModelSerializer): | ||
class Meta: | ||
model = Ticket | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
from rest_framework import viewsets | ||
from events.serializers.serializers import * | ||
from rest_framework.permissions import AllowAny | ||
from events.models.costs import Costs | ||
from events.models.event import Event | ||
from events.models.participant import Participant | ||
from events.models.application import EventApplication | ||
from events.models.ticket import Ticket | ||
|
||
class CostsViewSet(viewsets.ModelViewSet): | ||
serializer_class = CostsSerializer | ||
permission_classes = [AllowAny] | ||
queryset = Costs.objects.all() | ||
|
||
class EventViewSet(viewsets.ModelViewSet): | ||
serializer_class = EventSerializer | ||
permission_classes = [AllowAny] | ||
queryset = Event.objects.all() | ||
|
||
class ParticipantViewSet(viewsets.ModelViewSet): | ||
serializer_class = ParticipantSerializer | ||
permission_classes = [AllowAny] | ||
queryset = Participant.objects.all() | ||
|
||
class EventApplicationViewSet(viewsets.ModelViewSet): | ||
serializer_class = EventApplicationSerializer | ||
permission_classes = [AllowAny] | ||
queryset = EventApplication.objects.all() | ||
|
||
class TicketViewSet(viewsets.ModelViewSet): | ||
serializer_class = TicketSerializer | ||
permission_classes = [AllowAny] | ||
queryset = Ticket.objects.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from involvement.models.position import Position | ||
from rest_framework import serializers | ||
|
||
class PositionSerializer(serializers.ModelSerializer): | ||
class Meta: | ||
model = Position | ||
fields = '__all__' | ||
|
||
class PositionDepthSerializer(serializers.ModelSerializer): | ||
class Meta: | ||
model = Position | ||
fields = '__all__' | ||
depth = 1 |
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,14 @@ | ||
from rest_framework import viewsets | ||
from involvement.serializers.position_serializer import PositionSerializer, PositionDepthSerializer | ||
from rest_framework.permissions import AllowAny | ||
from involvement.models.position import Position | ||
|
||
class PositionViewSet(viewsets.ModelViewSet): | ||
serializer_class = PositionSerializer | ||
permission_classes = [AllowAny] | ||
queryset = Position.objects.all() | ||
|
||
class Position2ViewSet(viewsets.ModelViewSet): | ||
serializer_class = PositionDepthSerializer | ||
permission_classes = [AllowAny] | ||
queryset = Position.objects.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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reasons for these changes? Committed by mistake?