Esempio n. 1
0
# -*- coding: utf-8 -*-
from soft_drf.routing.v1.routers import router

from .viewsets import (
    documentationtype,
    documentation,
    answer,
)

router.register(
    r"documentationtypes",
    documentationtype.DocumentationTypeViewSet,
    base_name="documentationtypes",
)

router.register(
    r"documentations",
    documentation.DocumentationViewSet,
    base_name="documentations",
)

router.register(
    r"answers",
    answer.AnswerViewSet,
    base_name="answers",
)
Esempio n. 2
0
# -*- coding: utf-8 -*-
from soft_drf.routing.v1.routers import router

from .viewsets import (
    apptype,
    app,
    port,
)


router.register(
    r"apptypes",
    apptype.AppTypeViewSet,
    base_name="apptypes",
)

router.register(
    r"apps",
    app.AppViewSet,
    base_name="apps",
)

router.register(
    r"ports",
    port.PortViewSet,
    base_name="ports",
)
        return get_object_or_404(queryset, email=email)

    def create(self, request, *args, **kwargs):
        data = request.data
        serializer = self.get_serializer(data=data, action="create")

        if serializer.is_valid(raise_exception=True):
            response_serializer = self.get_serializer(
                {'email': serializer.data.get('email')},
                action="retrieve"
            )
            response_data = response_serializer.data
            del response_data['email']
            return Response(response_data, status=status.HTTP_200_OK)

        return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)


router.register(
    r"signin",
    SigninViewSet,
    base_name="signin"
)

router.register(
    'me',
    ProfileViewSet,
    base_name='me',
    router_class=SingleObjectRouter
)
Esempio n. 4
0
# -*- coding: utf-8 -*-
from soft_drf.routing.v1.routers import router

from .viewsets import (
    domain, )

router.register(
    r"domains",
    domain.DomainViewSet,
    base_name="domains",
)
Esempio n. 5
0
# -*- coding: utf-8 -*-
from soft_drf.routing.v1.routers import router

from .viewsets import (
    server,
    environment,
)

router.register(
    r"servers",
    server.ServerViewSet,
    base_name="servers",
)

router.register(
    r"environments",
    environment.EnvironmentViewSet,
    base_name="environments",
)
Esempio n. 6
0
# -*- coding: utf-8 -*-
from soft_drf.routing.v1.routers import router

from .viewsets import (
    provider, )

router.register(
    r"providers",
    provider.ProviderViewSet,
    base_name="providers",
)