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
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
def ormar_implementation_string_pk(): app = get_app() app.include_router( OrmarCRUDRouter( schema=PotatoTypeModel, prefix="potato_type", )) return app
def ormar_implementation_custom_ids(): app = get_app() app.include_router( OrmarCRUDRouter( schema=CustomPotatoModel, prefix="potatoes", paginate=PAGINATION_SIZE, )) return app
from fastapi_crudrouter import OrmarCRUDRouter from app.db.models.user import User router = OrmarCRUDRouter(schema=User)