mirror of
https://github.com/bringout/oca-technical.git
synced 2026-04-18 10:52:03 +02:00
Initial commit: OCA Technical packages (595 packages)
This commit is contained in:
commit
2cc02aac6e
24950 changed files with 2318079 additions and 0 deletions
|
|
@ -0,0 +1 @@
|
|||
from . import fastapi_endpoint_demo
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
# Copyright 2023 ACSONE SA/NV
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import models
|
||||
|
||||
from fastapi import APIRouter
|
||||
|
||||
from ..tests.routers import demo_pydantic_router
|
||||
|
||||
|
||||
class FastapiEndpoint(models.Model):
|
||||
|
||||
_inherit = "fastapi.endpoint"
|
||||
|
||||
def _get_fastapi_routers(self) -> list[APIRouter]:
|
||||
# Add router defined for tests to the demo app
|
||||
routers = super()._get_fastapi_routers()
|
||||
if self.app == "demo":
|
||||
routers.append(demo_pydantic_router)
|
||||
return routers
|
||||
Loading…
Add table
Add a link
Reference in a new issue