Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: [ADD] event_rest_api #247

Draft
wants to merge 6 commits into
base: 14.0
Choose a base branch
from

Conversation

qgroulard
Copy link

No description provided.

event_ticket_id: int = None


class EventRegistrationParamList(models.BaseModel):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@qgroulard IMO This class should not exists.... Do you really need to nest a list as attribute of an other model?


@restapi.method(
routes=[(["/<int:id>/registration"], "POST")],
input_param=PydanticModel(EventRegistrationParamList),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not PydanticModelList(EventRegistrationParam)?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because lists are not supported as parameters.
I can't figure out how to solve this. Or is PydanticModelList the way to go ?

Traceback (most recent call last):
  File "/home/quentin/.virtualenvs/odoo-ecolo-14/lib/python3.6/site-packages/odoo/addons/base/models/ir_http.py", line 237, in _dispatch
    result = request.dispatch()
  File "/home/quentin/.virtualenvs/odoo-ecolo-14/lib/python3.6/site-packages/odoo/http.py", line 807, in dispatch
    r = self._call_function(**self.params)
Exception

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/quentin/Documents/oca/rest-framework/base_rest/http.py", line 182, in _handle_exception
    return super(HttpRestRequest, self)._handle_exception(exception)
  File "/home/quentin/.virtualenvs/odoo-ecolo-14/lib/python3.6/site-packages/odoo/http.py", line 745, in _handle_exception
    return super(HttpRequest, self)._handle_exception(exception)
  File "/home/quentin/.virtualenvs/odoo-ecolo-14/lib/python3.6/site-packages/odoo/http.py", line 316, in _handle_exception
    raise exception.with_traceback(None) from new_cause
TypeError: _call_function() argument after ** must be a mapping, not list

@qgroulard qgroulard force-pushed the 14.0-event_rest_api-qgr branch 8 times, most recently from 6e43f8c to 8358d1a Compare December 9, 2021 11:04
@github-actions
Copy link

github-actions bot commented Jun 5, 2022

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Jun 5, 2022
@github-actions github-actions bot closed this Jul 10, 2022
@sbidoul sbidoul reopened this Jan 9, 2023
@sbidoul sbidoul added no stale Use this label to prevent the automated stale action from closing this PR/Issue. and removed stale PR/Issue without recent activity, it'll be soon closed automatically. labels Jan 9, 2023
qgroulard added a commit to acsone/mozaik that referenced this pull request Jul 19, 2023
marielejeune pushed a commit to acsone/mozaik that referenced this pull request Sep 19, 2023
marielejeune pushed a commit to acsone/mozaik that referenced this pull request Sep 20, 2023
marielejeune pushed a commit to acsone/mozaik that referenced this pull request Sep 26, 2023
marielejeune pushed a commit to acsone/mozaik that referenced this pull request Sep 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no stale Use this label to prevent the automated stale action from closing this PR/Issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants