`_ can
-be found on GitHub.
diff --git a/pydantic/readme/USAGE.md b/pydantic/readme/USAGE.md
new file mode 100644
index 000000000..92327bb6a
--- /dev/null
+++ b/pydantic/readme/USAGE.md
@@ -0,0 +1,32 @@
+To support pydantic models that map to Odoo models, Pydantic model
+instances can be created from arbitrary odoo model instances by mapping
+fields from odoo models to fields defined by the pydantic model. To ease
+the mapping, the addon provide a utility class
+odoo.addons.pydantic.utils.GenericOdooGetter.
+
+``` python
+import pydantic
+from odoo.addons.pydantic import utils
+
+class Group(pydantic.BaseModel):
+ name: str
+
+ class Config:
+ orm_mode = True
+ getter_dict = utils.GenericOdooGetter
+
+class UserInfo(pydantic.BaseModel):
+ name: str
+ groups: List[Group] = pydantic.Field(alias="groups_id")
+
+ class Config:
+ orm_mode = True
+ getter_dict = utils.GenericOdooGetter
+
+user = self.env.user
+user_info = UserInfo.from_orm(user)
+```
+
+See the official [Pydantic
+documentation](https://pydantic-docs.helpmanual.io/) to discover all the
+available functionalities.
diff --git a/pydantic/readme/USAGE.rst b/pydantic/readme/USAGE.rst
deleted file mode 100644
index f52f1c594..000000000
--- a/pydantic/readme/USAGE.rst
+++ /dev/null
@@ -1,31 +0,0 @@
-To support pydantic models that map to Odoo models, Pydantic model instances can
-be created from arbitrary odoo model instances by mapping fields from odoo
-models to fields defined by the pydantic model. To ease the mapping, the addon
-provide a utility class `odoo.addons.pydantic.utils.GenericOdooGetter`.
-
-.. code-block:: python
-
- import pydantic
- from odoo.addons.pydantic import utils
-
- class Group(pydantic.BaseModel):
- name: str
-
- class Config:
- orm_mode = True
- getter_dict = utils.GenericOdooGetter
-
- class UserInfo(pydantic.BaseModel):
- name: str
- groups: List[Group] = pydantic.Field(alias="groups_id")
-
- class Config:
- orm_mode = True
- getter_dict = utils.GenericOdooGetter
-
- user = self.env.user
- user_info = UserInfo.from_orm(user)
-
-See the official `Pydantic documentation`_ to discover all the available functionalities.
-
-.. _`Pydantic documentation`: https://pydantic-docs.helpmanual.io/
diff --git a/pydantic/static/description/index.html b/pydantic/static/description/index.html
index 91cd586f1..e8083ea5a 100644
--- a/pydantic/static/description/index.html
+++ b/pydantic/static/description/index.html
@@ -1,4 +1,3 @@
-
@@ -9,10 +8,11 @@
/*
:Author: David Goodger (goodger@python.org)
-:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
+:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
+Despite the name, some widely supported CSS2 features are used.
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
@@ -275,7 +275,7 @@
margin-left: 2em ;
margin-right: 2em }
-pre.code .ln { color: grey; } /* line numbers */
+pre.code .ln { color: gray; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
@@ -301,7 +301,7 @@
span.pre {
white-space: pre }
-span.problematic {
+span.problematic, pre.problematic {
color: red }
span.section-subtitle {
@@ -369,12 +369,14 @@ Pydantic
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:dfff59b19d2faa3595976c86a0480fc8f5b7112148ad7de50cccdb6faa610aa8
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-
+
This addon provides a utility method that can be used to map odoo record
to a Pydantic model.
-If you need to make your Pydantic models extendable at runtime, takes a look
-at the python package extendable-pydantic
-and the odoo addon extendable
+If you need to make your Pydantic models extendable at runtime, takes a
+look at the python package
+extendable-pydantic
+and the odoo addon
+extendable
Table of contents
@@ -391,10 +393,11 @@ Pydantic
-
To support pydantic models that map to Odoo models, Pydantic model instances can
-be created from arbitrary odoo model instances by mapping fields from odoo
-models to fields defined by the pydantic model. To ease the mapping, the addon
-provide a utility class odoo.addons.pydantic.utils.GenericOdooGetter.
+
To support pydantic models that map to Odoo models, Pydantic model
+instances can be created from arbitrary odoo model instances by mapping
+fields from odoo models to fields defined by the pydantic model. To ease
+the mapping, the addon provide a utility class
+odoo.addons.pydantic.utils.GenericOdooGetter.
import pydantic
from odoo.addons.pydantic import utils
@@ -417,20 +420,24 @@
user = self.env.user
user_info = UserInfo.from_orm(user)
-
See the official Pydantic documentation to discover all the available functionalities.
+
See the official Pydantic
+documentation to discover all
+the available functionalities.
Bugs are tracked on GitHub Issues.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
-feedback.
+
feedback.
Do not contact contributors directly about support or help with technical issues.
This module is maintained by the OCA.
-
+
+
+
OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
Current maintainer:
-
This module is part of the OCA/rest-framework project on GitHub.
+
This module is part of the OCA/rest-framework project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/requirements.txt b/requirements.txt
index bcba9b734..058f53dad 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,6 +1,9 @@
# generated from manifests external_dependencies
a2wsgi>=1.10.6
+contextvars
fastapi>=0.110.0
parse-accept-language
+pydantic
python-multipart
+typing-extensions
ujson