===================
Base Rest Datamodel
===================
..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:632b35243641f36c3ca35bc933ba7583ff963556c68379ee46f58fda26873ba3
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Frest--framework-lightgray.png?logo=github
:target: https://github.com/OCA/rest-framework/tree/16.0/base_rest_datamodel
:alt: OCA/rest-framework
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/rest-framework-16-0/rest-framework-16-0-base_rest_datamodel
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/rest-framework&target_branch=16.0
:alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5|
This addon allows you to use DataModel objects as params and/or response with your
REST API methods.
**Table of contents**
.. contents::
:local:
Usage
=====
To use DataModel instances as request and/or response of a REST service endpoint
you must:
* Define your DataModel objects;
* Provides the information required to the ``odoo.addons.base_rest.restapi.method`` decorator;
.. code-block:: python
from marshmallow import fields
from odoo.addons.base_rest import restapi
from odoo.addons.component.core import Component
from odoo.addons.datamodel.core import Datamodel
class PingMessage(Datamodel):
_name = "ping.message"
message = fields.String(required=True, allow_none=False)
class PingService(Component):
_inherit = 'base.rest.service'
_name = 'ping.service'
_usage = 'ping'
_collection = 'my_module.services'
@restapi.method(
[(["/pong"], "GET")],
input_param=restapi.Datamodel("ping.message"),
output_param=restapi.Datamodel("ping.message"),
auth="public",
)
def pong(self, ping_message):
PingMessage = self.env.datamodels["ping.message"]
return PingMessage(message = "Received: " + ping_message.message)
Bug Tracker
===========
Bugs are tracked on `GitHub Issues <https://github.com/OCA/rest-framework/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 <https://github.com/OCA/rest-framework/issues/new?body=module:%20base_rest_datamodel%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
Credits
=======
Authors
~~~~~~~
* ACSONE SA/NV
Contributors
~~~~~~~~~~~~
* Laurent Mignon <laurent.mignon@acsone.eu>
Maintainers
~~~~~~~~~~~
This module is maintained by the OCA.
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org
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.
This module is part of the `OCA/rest-framework <https://github.com/OCA/rest-framework/tree/16.0/base_rest_datamodel>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Raw data
{
"_id": null,
"home_page": "https://github.com/OCA/rest-framework",
"name": "odoo-addon-base-rest-datamodel",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": "",
"keywords": "",
"author": "ACSONE SA/NV,Odoo Community Association (OCA)",
"author_email": "support@odoo-community.org",
"download_url": "",
"platform": null,
"description": "===================\nBase Rest Datamodel\n===================\n\n.. \n !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n !! This file is generated by oca-gen-addon-readme !!\n !! changes will be overwritten. !!\n !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n !! source digest: sha256:632b35243641f36c3ca35bc933ba7583ff963556c68379ee46f58fda26873ba3\n !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\n.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png\n :target: https://odoo-community.org/page/development-status\n :alt: Beta\n.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png\n :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html\n :alt: License: LGPL-3\n.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Frest--framework-lightgray.png?logo=github\n :target: https://github.com/OCA/rest-framework/tree/16.0/base_rest_datamodel\n :alt: OCA/rest-framework\n.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png\n :target: https://translation.odoo-community.org/projects/rest-framework-16-0/rest-framework-16-0-base_rest_datamodel\n :alt: Translate me on Weblate\n.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png\n :target: https://runboat.odoo-community.org/builds?repo=OCA/rest-framework&target_branch=16.0\n :alt: Try me on Runboat\n\n|badge1| |badge2| |badge3| |badge4| |badge5|\n\nThis addon allows you to use DataModel objects as params and/or response with your\nREST API methods.\n\n**Table of contents**\n\n.. contents::\n :local:\n\nUsage\n=====\n\nTo use DataModel instances as request and/or response of a REST service endpoint\nyou must:\n\n* Define your DataModel objects;\n* Provides the information required to the ``odoo.addons.base_rest.restapi.method`` decorator;\n\n\n.. code-block:: python\n\n from marshmallow import fields\n\n from odoo.addons.base_rest import restapi\n from odoo.addons.component.core import Component\n from odoo.addons.datamodel.core import Datamodel\n\n class PingMessage(Datamodel):\n _name = \"ping.message\"\n\n message = fields.String(required=True, allow_none=False)\n\n\n class PingService(Component):\n _inherit = 'base.rest.service'\n _name = 'ping.service'\n _usage = 'ping'\n _collection = 'my_module.services'\n\n\n @restapi.method(\n [([\"/pong\"], \"GET\")],\n input_param=restapi.Datamodel(\"ping.message\"),\n output_param=restapi.Datamodel(\"ping.message\"),\n auth=\"public\",\n )\n def pong(self, ping_message):\n PingMessage = self.env.datamodels[\"ping.message\"]\n return PingMessage(message = \"Received: \" + ping_message.message)\n\nBug Tracker\n===========\n\nBugs are tracked on `GitHub Issues <https://github.com/OCA/rest-framework/issues>`_.\nIn case of trouble, please check there if your issue has already been reported.\nIf you spotted it first, help us to smash it by providing a detailed and welcomed\n`feedback <https://github.com/OCA/rest-framework/issues/new?body=module:%20base_rest_datamodel%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.\n\nDo not contact contributors directly about support or help with technical issues.\n\nCredits\n=======\n\nAuthors\n~~~~~~~\n\n* ACSONE SA/NV\n\nContributors\n~~~~~~~~~~~~\n\n* Laurent Mignon <laurent.mignon@acsone.eu>\n\nMaintainers\n~~~~~~~~~~~\n\nThis module is maintained by the OCA.\n\n.. image:: https://odoo-community.org/logo.png\n :alt: Odoo Community Association\n :target: https://odoo-community.org\n\nOCA, or the Odoo Community Association, is a nonprofit organization whose\nmission is to support the collaborative development of Odoo features and\npromote its widespread use.\n\nThis module is part of the `OCA/rest-framework <https://github.com/OCA/rest-framework/tree/16.0/base_rest_datamodel>`_ project on GitHub.\n\nYou are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.\n\n\n",
"bugtrack_url": null,
"license": "LGPL-3",
"summary": "Datamodel binding for base_rest",
"version": "16.0.1.0.0.3",
"project_urls": {
"Homepage": "https://github.com/OCA/rest-framework"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "0435c53f320ea5ff254234b24f9ba99062648146cebf21f29f72439b783f1406",
"md5": "ae1f60aca9ec66e2658584a8a8a25ac5",
"sha256": "abdacca2bd1391aee901e1f4cdd849549c53cef3c0aadf11f693e0483c8bb5dd"
},
"downloads": -1,
"filename": "odoo_addon_base_rest_datamodel-16.0.1.0.0.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ae1f60aca9ec66e2658584a8a8a25ac5",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 25609,
"upload_time": "2023-09-03T10:27:40",
"upload_time_iso_8601": "2023-09-03T10:27:40.367126Z",
"url": "https://files.pythonhosted.org/packages/04/35/c53f320ea5ff254234b24f9ba99062648146cebf21f29f72439b783f1406/odoo_addon_base_rest_datamodel-16.0.1.0.0.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-09-03 10:27:40",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "OCA",
"github_project": "rest-framework",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "a2wsgi",
"specs": []
},
{
"name": "apispec",
"specs": []
},
{
"name": "apispec",
"specs": [
[
">=",
"4.0.0"
]
]
},
{
"name": "cerberus",
"specs": []
},
{
"name": "contextvars",
"specs": []
},
{
"name": "extendable-pydantic",
"specs": []
},
{
"name": "extendable-pydantic",
"specs": [
[
">=",
"1.1.0"
]
]
},
{
"name": "extendable",
"specs": [
[
">=",
"0.0.4"
]
]
},
{
"name": "fastapi",
"specs": []
},
{
"name": "graphene",
"specs": []
},
{
"name": "graphql_server",
"specs": []
},
{
"name": "jsondiff",
"specs": []
},
{
"name": "marshmallow",
"specs": []
},
{
"name": "marshmallow-objects",
"specs": [
[
">=",
"2.0.0"
]
]
},
{
"name": "parse-accept-language",
"specs": []
},
{
"name": "pydantic",
"specs": []
},
{
"name": "pydantic",
"specs": [
[
">=",
"2.0.0"
]
]
},
{
"name": "pyquerystring",
"specs": []
},
{
"name": "python-multipart",
"specs": []
},
{
"name": "typing-extensions",
"specs": []
},
{
"name": "ujson",
"specs": []
}
],
"lcname": "odoo-addon-base-rest-datamodel"
}