Skip to content
Snippets Groups Projects
Unverified Commit 55722b80 authored by me5na7qbjqbrp's avatar me5na7qbjqbrp
Browse files

Split API in each app

parent 987b898a
No related branches found
No related tags found
1 merge request!8API & autocomplétion
Pipeline #7729 passed with stage
in 3 minutes and 8 seconds
File moved
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Copyright (C) 2018-2020 by BDE ENS Paris-Saclay # Copyright (C) 2018-2020 by BDE ENS Paris-Saclay
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
from activity.models import ActivityType, Activity, Guest from ..models import ActivityType, Activity, Guest
from rest_framework import serializers from rest_framework import serializers
class ActivityTypeSerializer(serializers.ModelSerializer): class ActivityTypeSerializer(serializers.ModelSerializer):
......
File moved
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
from rest_framework import viewsets from rest_framework import viewsets
from activity.models import ActivityType, Activity, Guest from ..models import ActivityType, Activity, Guest
from .serializers import ActivityTypeSerializer, ActivitySerializer, GuestSerializer from .serializers import ActivityTypeSerializer, ActivitySerializer, GuestSerializer
......
...@@ -7,9 +7,9 @@ from django.contrib.auth.models import User ...@@ -7,9 +7,9 @@ from django.contrib.auth.models import User
from rest_framework import routers, serializers, viewsets from rest_framework import routers, serializers, viewsets
from rest_framework.authtoken import views as token_views from rest_framework.authtoken import views as token_views
from .activity.urls import register_activity_urls from activity.api.urls import register_activity_urls
from .members.urls import register_members_urls from member.api.urls import register_members_urls
from .note.urls import register_note_urls from note.api.urls import register_note_urls
class UserSerializer(serializers.ModelSerializer): class UserSerializer(serializers.ModelSerializer):
...@@ -34,16 +34,11 @@ class UserViewSet(viewsets.ModelViewSet): ...@@ -34,16 +34,11 @@ class UserViewSet(viewsets.ModelViewSet):
# Routers provide an easy way of automatically determining the URL conf. # Routers provide an easy way of automatically determining the URL conf.
# Register each app API router and user viewset
router = routers.DefaultRouter() router = routers.DefaultRouter()
router.register('user', UserViewSet) router.register('user', UserViewSet)
# Routers for members app
register_members_urls(router, 'members') register_members_urls(router, 'members')
# Routers for activity app
register_activity_urls(router, 'activity') register_activity_urls(router, 'activity')
# Routers for note app
register_note_urls(router, 'note') register_note_urls(router, 'note')
app_name = 'api' app_name = 'api'
......
File moved
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Copyright (C) 2018-2020 by BDE ENS Paris-Saclay # Copyright (C) 2018-2020 by BDE ENS Paris-Saclay
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
from member.models import Profile, Club, Role, Membership from ..models import Profile, Club, Role, Membership
from rest_framework import serializers from rest_framework import serializers
......
File moved
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
from rest_framework import viewsets from rest_framework import viewsets
from member.models import Profile, Club, Role, Membership from ..models import Profile, Club, Role, Membership
from .serializers import ProfileSerializer, ClubSerializer, RoleSerializer, MembershipSerializer from .serializers import ProfileSerializer, ClubSerializer, RoleSerializer, MembershipSerializer
......
File moved
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
# Copyright (C) 2018-2020 by BDE ENS Paris-Saclay # Copyright (C) 2018-2020 by BDE ENS Paris-Saclay
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
from note.models.notes import Note, NoteClub, NoteSpecial, NoteUser, Alias from ..models.notes import Note, NoteClub, NoteSpecial, NoteUser, Alias
from note.models.transactions import TransactionTemplate, Transaction, MembershipTransaction from ..models.transactions import TransactionTemplate, Transaction, MembershipTransaction
from rest_framework import serializers from rest_framework import serializers
from rest_polymorphic.serializers import PolymorphicSerializer from rest_polymorphic.serializers import PolymorphicSerializer
......
File moved
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
from django.db.models import Q from django.db.models import Q
from rest_framework import viewsets from rest_framework import viewsets
from note.models.notes import Note, NoteClub, NoteSpecial, NoteUser, Alias from ..models.notes import Note, NoteClub, NoteSpecial, NoteUser, Alias
from note.models.transactions import TransactionTemplate, Transaction, MembershipTransaction from ..models.transactions import TransactionTemplate, Transaction, MembershipTransaction
from .serializers import NoteSerializer, NotePolymorphicSerializer, NoteClubSerializer, NoteSpecialSerializer, \ from .serializers import NoteSerializer, NotePolymorphicSerializer, NoteClubSerializer, NoteSpecialSerializer, \
NoteUserSerializer, AliasSerializer, \ NoteUserSerializer, AliasSerializer, \
TransactionTemplateSerializer, TransactionSerializer, MembershipTransactionSerializer TransactionTemplateSerializer, TransactionSerializer, MembershipTransactionSerializer
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment