-
-
Notifications
You must be signed in to change notification settings - Fork 166
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
base: 14.0
Are you sure you want to change the base?
Conversation
event_ticket_id: int = None | ||
|
||
|
||
class EventRegistrationParamList(models.BaseModel): |
There was a problem hiding this comment.
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?
event_rest_api/services/event.py
Outdated
|
||
@restapi.method( | ||
routes=[(["/<int:id>/registration"], "POST")], | ||
input_param=PydanticModel(EventRegistrationParamList), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not PydanticModelList(EventRegistrationParam)
?
There was a problem hiding this comment.
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
6e43f8c
to
8358d1a
Compare
8358d1a
to
2d87e67
Compare
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. |
No description provided.