Saltar a contenido

register

app.core.register

Copyright © 2014-2024 Jorge Brunal Pérez diniremix@gmail.com

This file is part of Callisto.

Callisto is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

Callisto is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with Callisto; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

RegisterModules

Permite la carga de los módulos, esta clase es utilizada en el archivo principal del BackEnd.

Examples:

RegisterModules()

add_router(obj_view, endpoint, *args, **kwargs)

Utiliza api.include_router de APIRouter, para registrar un módulo.

Parameters:

Name Type Description Default
obj_view Class

la clase que se extiende de APIRouter

required
endpoint str

el nombre para el endpoint

required
*args Any

parámetros adicionales enviados a api.include_router

()
**kwargs Any

parámetros adicionales enviados a api.include_router

{}

Examples:

1
2
3
4
5
6
7
8
9
from my.awesome.module.views.my_view import my_custom_router
...

add_router(
    my_custom_router,
    "/me",
    tags=["me"],
    dependencies=[Depends(validate_auth_session)]
)