Move all the routers under their own dir.

master
Tom Hacohen 4 years ago
parent 8bf04fc286
commit dbdff06e68

@ -6,11 +6,11 @@ from fastapi.middleware.cors import CORSMiddleware
from fastapi.middleware.trustedhost import TrustedHostMiddleware from fastapi.middleware.trustedhost import TrustedHostMiddleware
from .exceptions import CustomHttpException from .exceptions import CustomHttpException
from .authentication import authentication_router
from .collection import collection_router, item_router
from .member import member_router
from .invitation import invitation_incoming_router, invitation_outgoing_router
from .msgpack import MsgpackResponse from .msgpack import MsgpackResponse
from .routers.authentication import authentication_router
from .routers.collection import collection_router, item_router
from .routers.member import member_router
from .routers.invitation import invitation_incoming_router, invitation_outgoing_router
def create_application(prefix="", middlewares=[]): def create_application(prefix="", middlewares=[]):
@ -38,7 +38,7 @@ def create_application(prefix="", middlewares=[]):
) )
if settings.DEBUG: if settings.DEBUG:
from etebase_fastapi.test_reset_view import test_reset_view_router from etebase_fastapi.routers.test_reset_view import test_reset_view_router
app.include_router(test_reset_view_router, prefix=f"{BASE_PATH}/test/authentication") app.include_router(test_reset_view_router, prefix=f"{BASE_PATH}/test/authentication")

@ -20,10 +20,10 @@ from django_etebase.models import UserInfo
from django_etebase.signals import user_signed_up from django_etebase.signals import user_signed_up
from django_etebase.utils import create_user, get_user_queryset, CallbackContext from django_etebase.utils import create_user, get_user_queryset, CallbackContext
from myauth.models import UserType, get_typed_user_model from myauth.models import UserType, get_typed_user_model
from .exceptions import AuthenticationFailed, transform_validation_error, HttpError from ..exceptions import AuthenticationFailed, transform_validation_error, HttpError
from .msgpack import MsgpackRoute from ..msgpack import MsgpackRoute
from .utils import BaseModel, permission_responses, msgpack_encode, msgpack_decode from ..utils import BaseModel, permission_responses, msgpack_encode, msgpack_decode
from .dependencies import AuthData, get_auth_data, get_authenticated_user from ..dependencies import AuthData, get_auth_data, get_authenticated_user
User = get_typed_user_model() User = get_typed_user_model()
authentication_router = APIRouter(route_class=MsgpackRoute) authentication_router = APIRouter(route_class=MsgpackRoute)

@ -10,10 +10,10 @@ from fastapi import APIRouter, Depends, status, Request
from django_etebase import models from django_etebase import models
from myauth.models import UserType, get_typed_user_model from myauth.models import UserType, get_typed_user_model
from .authentication import get_authenticated_user from .authentication import get_authenticated_user
from .exceptions import HttpError, transform_validation_error, PermissionDenied, ValidationError from ..exceptions import HttpError, transform_validation_error, PermissionDenied, ValidationError
from .msgpack import MsgpackRoute from ..msgpack import MsgpackRoute
from .stoken_handler import filter_by_stoken_and_limit, filter_by_stoken, get_stoken_obj, get_queryset_stoken from ..stoken_handler import filter_by_stoken_and_limit, filter_by_stoken, get_stoken_obj, get_queryset_stoken
from .utils import ( from ..utils import (
get_object_or_404, get_object_or_404,
Context, Context,
Prefetch, Prefetch,
@ -24,8 +24,8 @@ from .utils import (
PERMISSIONS_READ, PERMISSIONS_READ,
PERMISSIONS_READWRITE, PERMISSIONS_READWRITE,
) )
from .dependencies import get_collection_queryset, get_item_queryset, get_collection from ..dependencies import get_collection_queryset, get_item_queryset, get_collection
from .sendfile import sendfile from ..sendfile import sendfile
User = get_typed_user_model User = get_typed_user_model
collection_router = APIRouter(route_class=MsgpackRoute, responses=permission_responses) collection_router = APIRouter(route_class=MsgpackRoute, responses=permission_responses)

@ -8,9 +8,9 @@ from django_etebase import models
from django_etebase.utils import get_user_queryset, CallbackContext from django_etebase.utils import get_user_queryset, CallbackContext
from myauth.models import UserType, get_typed_user_model from myauth.models import UserType, get_typed_user_model
from .authentication import get_authenticated_user from .authentication import get_authenticated_user
from .exceptions import HttpError, PermissionDenied from ..exceptions import HttpError, PermissionDenied
from .msgpack import MsgpackRoute from ..msgpack import MsgpackRoute
from .utils import ( from ..utils import (
get_object_or_404, get_object_or_404,
Context, Context,
is_collection_admin, is_collection_admin,

@ -7,9 +7,9 @@ from fastapi import APIRouter, Depends, status
from django_etebase import models from django_etebase import models
from myauth.models import UserType, get_typed_user_model from myauth.models import UserType, get_typed_user_model
from .authentication import get_authenticated_user from .authentication import get_authenticated_user
from .msgpack import MsgpackRoute from ..msgpack import MsgpackRoute
from .utils import get_object_or_404, BaseModel, permission_responses, PERMISSIONS_READ, PERMISSIONS_READWRITE from ..utils import get_object_or_404, BaseModel, permission_responses, PERMISSIONS_READ, PERMISSIONS_READWRITE
from .stoken_handler import filter_by_stoken_and_limit from ..stoken_handler import filter_by_stoken_and_limit
from .collection import get_collection, verify_collection_admin from .collection import get_collection, verify_collection_admin

@ -4,9 +4,9 @@ from django.shortcuts import get_object_or_404
from fastapi import APIRouter, Request, status from fastapi import APIRouter, Request, status
from django_etebase.utils import get_user_queryset, CallbackContext from django_etebase.utils import get_user_queryset, CallbackContext
from etebase_fastapi.authentication import SignupIn, signup_save from .authentication import SignupIn, signup_save
from etebase_fastapi.msgpack import MsgpackRoute from ..msgpack import MsgpackRoute
from etebase_fastapi.exceptions import HttpError from ..exceptions import HttpError
from myauth.models import get_typed_user_model from myauth.models import get_typed_user_model
test_reset_view_router = APIRouter(route_class=MsgpackRoute, tags=["test helpers"]) test_reset_view_router = APIRouter(route_class=MsgpackRoute, tags=["test helpers"])
Loading…
Cancel
Save