Traceback (most recent call last):
File "lib/python3.12/site-packages/sqlalchemy/engine/result.py", line 199, in _key_not_found
self._key_fallback(key, None)
File "lib/python3.12/site-packages/sqlalchemy/engine/result.py", line 138, in _key_fallback
raise KeyError(key) from err
KeyError: '__table__'
The above exception was the direct cause of the following exception:
File "/dev/FELINN/hiboo/hiboo/moderation/templates/moderation_home.html", line 12, in block 'content'
{{ render_table(profiles, primary_key='uuid') }}
File "lib/python3.12/site-packages/jinja2/runtime.py", line 782, in _invoke
rv = self._func(*arguments)
^^^^^^^^^^^^^^^^^^^^^^
File "lib/python3.12/site-packages/flask_bootstrap/templates/base/table.html", line 48, in template
{% set titles = get_table_titles(data, primary_key, primary_key_title) %}
File "lib/python3.12/site-packages/flask_bootstrap/__init__.py", line 26, in get_table_titles
for k in data[0].__table__.columns.keys():
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "lib/sqlalchemy/cyextension/resultproxy.pyx", line 66, in sqlalchemy.cyextension.resultproxy.BaseRow.__getattr__
File "lib/sqlalchemy/cyextension/resultproxy.pyx", line 63, in sqlalchemy.cyextension.resultproxy.BaseRow._get_by_key_impl
File "lib/python3.12/site-packages/sqlalchemy/engine/result.py", line 201, in _key_not_found
raise AttributeError(ke.args[0]) from ke
AttributeError: __table__. Did you mean: '__le__'?
I double checked that uuid is indeed the primary key, but the result is the same with or without primary_key='uuid'.
Hello! Thanks for this beautiful library :)
I got an unexpected error when trying to use the table utility. Here is some context:
vue:
template (working :green_circle:)
```twig
template (not working :red_circle:)
error:
I double checked that
uuid
is indeed the primary key, but the result is the same with or withoutprimary_key='uuid'
.The error appeared after I introduced
profiles = profiles.with_entities(models.Profile.uuid, models.Profile.username).all()
in my request. Without that column filter, everything works very well.