mirror of https://gitlab.crans.org/bde/nk20
Split API in each app
This commit is contained in:
parent
987b898a33
commit
55722b801a
|
@ -2,7 +2,7 @@
|
|||
# Copyright (C) 2018-2020 by BDE ENS Paris-Saclay
|
||||
# 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
|
||||
|
||||
class ActivityTypeSerializer(serializers.ModelSerializer):
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
from rest_framework import viewsets
|
||||
|
||||
from activity.models import ActivityType, Activity, Guest
|
||||
from ..models import ActivityType, Activity, Guest
|
||||
from .serializers import ActivityTypeSerializer, ActivitySerializer, GuestSerializer
|
||||
|
||||
|
|
@ -7,9 +7,9 @@ from django.contrib.auth.models import User
|
|||
from rest_framework import routers, serializers, viewsets
|
||||
from rest_framework.authtoken import views as token_views
|
||||
|
||||
from .activity.urls import register_activity_urls
|
||||
from .members.urls import register_members_urls
|
||||
from .note.urls import register_note_urls
|
||||
from activity.api.urls import register_activity_urls
|
||||
from member.api.urls import register_members_urls
|
||||
from note.api.urls import register_note_urls
|
||||
|
||||
|
||||
class UserSerializer(serializers.ModelSerializer):
|
||||
|
@ -34,16 +34,11 @@ class UserViewSet(viewsets.ModelViewSet):
|
|||
|
||||
|
||||
# Routers provide an easy way of automatically determining the URL conf.
|
||||
# Register each app API router and user viewset
|
||||
router = routers.DefaultRouter()
|
||||
router.register('user', UserViewSet)
|
||||
|
||||
# Routers for members app
|
||||
register_members_urls(router, 'members')
|
||||
|
||||
# Routers for activity app
|
||||
register_activity_urls(router, 'activity')
|
||||
|
||||
# Routers for note app
|
||||
register_note_urls(router, 'note')
|
||||
|
||||
app_name = 'api'
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# Copyright (C) 2018-2020 by BDE ENS Paris-Saclay
|
||||
# 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
|
||||
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
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
|
||||
|
||||
|
|
@ -2,8 +2,8 @@
|
|||
# Copyright (C) 2018-2020 by BDE ENS Paris-Saclay
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from note.models.notes import Note, NoteClub, NoteSpecial, NoteUser, Alias
|
||||
from note.models.transactions import TransactionTemplate, Transaction, MembershipTransaction
|
||||
from ..models.notes import Note, NoteClub, NoteSpecial, NoteUser, Alias
|
||||
from ..models.transactions import TransactionTemplate, Transaction, MembershipTransaction
|
||||
from rest_framework import serializers
|
||||
from rest_polymorphic.serializers import PolymorphicSerializer
|
||||
|
|
@ -5,8 +5,8 @@
|
|||
from django.db.models import Q
|
||||
from rest_framework import viewsets
|
||||
|
||||
from note.models.notes import Note, NoteClub, NoteSpecial, NoteUser, Alias
|
||||
from note.models.transactions import TransactionTemplate, Transaction, MembershipTransaction
|
||||
from ..models.notes import Note, NoteClub, NoteSpecial, NoteUser, Alias
|
||||
from ..models.transactions import TransactionTemplate, Transaction, MembershipTransaction
|
||||
from .serializers import NoteSerializer, NotePolymorphicSerializer, NoteClubSerializer, NoteSpecialSerializer, \
|
||||
NoteUserSerializer, AliasSerializer, \
|
||||
TransactionTemplateSerializer, TransactionSerializer, MembershipTransactionSerializer
|
Loading…
Reference in New Issue