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,19 @@
|
|||
from typing import Annotated, Generic, TypeVar
|
||||
|
||||
from extendable_pydantic import StrictExtendableBaseModel
|
||||
|
||||
from pydantic import Field
|
||||
|
||||
T = TypeVar("T")
|
||||
|
||||
|
||||
class PagedCollection(StrictExtendableBaseModel, Generic[T]):
|
||||
"""A paged collection of items"""
|
||||
|
||||
# This is a generic model. The type of the items is defined by the generic type T.
|
||||
# It provides you a common way to return a paged collection of items of
|
||||
# extendable models. It's based on the StrictExtendableBaseModel to ensure
|
||||
# a strict validation when used within the odoo fastapi framework.
|
||||
|
||||
count: Annotated[int, Field(..., description="The count of items into the system")]
|
||||
items: list[T]
|
||||
Loading…
Add table
Add a link
Reference in a new issue