Exemplo n.º 1
0
def ormar_implementation():
    app = get_app()

    app.include_router(
        OrmarCRUDRouter(
            schema=PotatoModel,
            prefix="potato",
            paginate=PAGINATION_SIZE,
        ))
    app.include_router(
        OrmarCRUDRouter(
            schema=CarrotModel,
            update_schema=CarrotUpdate,
            prefix="carrot",
        ))

    return app
Exemplo n.º 2
0
def ormar_implementation_integrity_errors():
    app = get_app()

    app.include_router(
        OrmarCRUDRouter(
            schema=UniquePotatoModel,
            prefix="potatoes",
            paginate=PAGINATION_SIZE,
        ))
    app.include_router(
        OrmarCRUDRouter(
            schema=CarrotModel,
            create_schema=CarrotCreate,
            update_schema=CarrotUpdate,
            prefix="carrots",
        ))

    return app
Exemplo n.º 3
0
def ormar_implementation_string_pk():
    app = get_app()

    app.include_router(
        OrmarCRUDRouter(
            schema=PotatoTypeModel,
            prefix="potato_type",
        ))

    return app
Exemplo n.º 4
0
def ormar_implementation_custom_ids():
    app = get_app()

    app.include_router(
        OrmarCRUDRouter(
            schema=CustomPotatoModel,
            prefix="potatoes",
            paginate=PAGINATION_SIZE,
        ))

    return app
Exemplo n.º 5
0
from fastapi_crudrouter import OrmarCRUDRouter

from app.db.models.user import User

router = OrmarCRUDRouter(schema=User)