i was trying to do a list:reference to a table however i noticed that the has_many isn't an actual field(which is needed for it to go into a form). whenever i tried adding a list of references to refers_to it also threw an error:
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'list'
full traceback:
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/emmett/rsgi/handlers.py", line 203, in dynamic_handler
http = await self.router.dispatch(request, response)
File "/usr/local/lib/python3.11/site-packages/emmett/routing/router.py", line 249, in dispatch
return await match.dispatch(reqargs, response)
File "/usr/local/lib/python3.11/site-packages/emmett/routing/dispatchers.py", line 72, in dispatch
rv = self.response_builder(await self.f(**reqargs), response)
File "/usr/local/lib/python3.11/site-packages/emmett/pipeline.py", line 328, in flow
output = await pipe_method(f, **kwargs)
File "/usr/local/lib/python3.11/site-packages/emmett/pipeline.py", line 234, in pipe
return await next_pipe(**kwargs)
File "/usr/local/lib/python3.11/site-packages/emmett/pipeline.py", line 328, in flow
output = await pipe_method(f, **kwargs)
File "/usr/local/lib/python3.11/site-packages/emmett/tools/auth/apis.py", line 277, in pipe
return await next_pipe(**kwargs)
File "/usr/local/lib/python3.11/site-packages/emmett/pipeline.py", line 369, in flow
return await pipe_method(f, **kwargs)
File "/usr/local/lib/python3.11/site-packages/emmett/pipeline.py", line 274, in pipe_request
return await next_pipe(**kwargs)
File "/app/testem/controllers/microlearnings.py", line 27, in microlearning_content
grid = await SQLFORM.grid(query, GridSettings())
File "/app/testem/tools/sqlgrid.py", line 129, in grid
return await cls.__insert_form(query_helper, grid_settings)
File "/app/testem/tools/sqlgrid.py", line 152, in __insert_form
form = await model.form()
File "/usr/local/lib/python3.11/site-packages/emmett/forms.py", line 399, in _process
await super()._process(write_defaults=False)
File "/usr/local/lib/python3.11/site-packages/emmett/forms.py", line 165, in _process
self._validate_input()
File "/usr/local/lib/python3.11/site-packages/emmett/forms.py", line 383, in _validate_input
record.update(fields)
File "/usr/local/lib/python3.11/site-packages/emmett/orm/objects.py", line 1438, in update
self.__setattr__(key, val)
File "/usr/local/lib/python3.11/site-packages/emmett/orm/objects.py", line 1381, in __setattr__
object.__setattr__(self, key, value)
File "/usr/local/lib/python3.11/site-packages/emmett/orm/models.py", line 1158, in __set__
val = typed_row_reference(val, self.table)
File "/usr/local/lib/python3.11/site-packages/emmett/orm/helpers.py", line 558, in typed_row_reference
return {
File "/usr/local/lib/python3.11/site-packages/emmett/orm/helpers.py", line 121, in __new__
rv = super().__new__(cls, id, *args, **kwargs)
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'list'
is there any way to get a list of references without using has_many or can you make it so has_many works in forms?
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too