Hi, I found wat looks like a bug about Grid and DAL pymysql connections. Here is the error traceback:
Traceback (most recent call last):
File "/home/alanetkinet29/py4web/py4web/core.py", line 1061, in wrapper
ret = func(*func_args, **func_kwargs)
File "/home/alanetkinet29/py4web/py4web/core.py", line 1046, in wrapper
raise exception
File "/home/alanetkinet29/py4web/py4web/core.py", line 1022, in wrapper
context["output"] = func(*args, **kwargs)
~~~~^^^^^^^^^^^^^^^^^
File "/home/alanetkinet29/py4web/apps/proyectero/controllers.py", line 384, in tasks
grid = Grid(query=db.task.stage.belongs(stage_list),
columns=columns,
create=is_admin,
editable=is_admin,
deletable=is_admin)
File "/home/alanetkinet29/py4web/py4web/utils/grid.py", line 572, in __init__
self.process()
~~~~~~~~~~~~^^
File "/home/alanetkinet29/py4web/py4web/utils/grid.py", line 645, in process
self._handle_mode_select()
~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/home/alanetkinet29/py4web/py4web/utils/grid.py", line 781, in _handle_mode_select
col.type_name
AttributeError: 'Field' object has no attribute 'type_name'
The app was delployed in Pythonanywhere with the recipe from the docs
The same error with last py4web git version and using version 1.20251212.1
It looks like the Field objects from the mysql connection do not implement a .type_name attribute where with other dal adapters they do (i.e. SQLlite). Patching grid.py 781 to use .type instead of .type_name changes grid behavior since list types are rendered as python lists.
I'm using pymysql, perhaps I should change the mysql adapter?
Regards
Alan