sqladmin: TypeError: Boolean value of this clause is not defined
Checklist
- The bug is reproducible against the latest release or
master
. - There are no similar issues or pull requests to fix it yet.
Describe the bug
Traceback during open ‘Create’ page (url for example): http://127.0.0.1:8000/admin/user/create
File “/Users/iuliia_volkova2/Library/Caches/pypoetry/virtualenvs/admin-panel-service-Ji2bEy0B-py3.7/lib/python3.7/site-packages/starlette/templating.py”, line 37, in init content = template.render(context) File “/Users/iuliia_volkova2/Library/Caches/pypoetry/virtualenvs/admin-panel-service-Ji2bEy0B-py3.7/lib/python3.7/site-packages/jinja2/environment.py”, line 1301, in render self.environment.handle_exception() File “/Users/iuliia_volkova2/Library/Caches/pypoetry/virtualenvs/admin-panel-service-Ji2bEy0B-py3.7/lib/python3.7/site-packages/jinja2/environment.py”, line 936, in handle_exception raise rewrite_traceback_stack(source=source) File “/Users/iuliia_volkova2/Library/Caches/pypoetry/virtualenvs/admin-panel-service-Ji2bEy0B-py3.7/lib/python3.7/site-packages/sqladmin/templates/create.html”, line 1, in top-level template code {% extends “layout.html” %} File “/Users/iuliia_volkova2/Library/Caches/pypoetry/virtualenvs/admin-panel-service-Ji2bEy0B-py3.7/lib/python3.7/site-packages/sqladmin/templates/layout.html”, line 1, in top-level template code {% extends “base.html” %} File “/Users/iuliia_volkova2/Library/Caches/pypoetry/virtualenvs/admin-panel-service-Ji2bEy0B-py3.7/lib/python3.7/site-packages/sqladmin/templates/base.html”, line 15, in top-level template code {% block body %} File “/Users/iuliia_volkova2/Library/Caches/pypoetry/virtualenvs/admin-panel-service-Ji2bEy0B-py3.7/lib/python3.7/site-packages/sqladmin/templates/layout.html”, line 49, in block ‘body’ {% block content %} {% endblock %} File “/Users/iuliia_volkova2/Library/Caches/pypoetry/virtualenvs/admin-panel-service-Ji2bEy0B-py3.7/lib/python3.7/site-packages/sqladmin/templates/create.html”, line 18, in block ‘content’ {{ field() }} File “/Users/iuliia_volkova2/Library/Caches/pypoetry/virtualenvs/admin-panel-service-Ji2bEy0B-py3.7/lib/python3.7/site-packages/wtforms/fields/core.py”, line 172, in call return self.meta.render_field(self, kwargs) File “/Users/iuliia_volkova2/Library/Caches/pypoetry/virtualenvs/admin-panel-service-Ji2bEy0B-py3.7/lib/python3.7/site-packages/wtforms/meta.py”, line 64, in render_field return field.widget(field, **render_kw) File “/Users/iuliia_volkova2/Library/Caches/pypoetry/virtualenvs/admin-panel-service-Ji2bEy0B-py3.7/lib/python3.7/site-packages/wtforms/widgets/core.py”, line 174, in call kwargs[“value”] = field._value() File “/Users/iuliia_volkova2/Library/Caches/pypoetry/virtualenvs/admin-panel-service-Ji2bEy0B-py3.7/lib/python3.7/site-packages/wtforms/fields/datetime.py”, line 36, in _value return self.data and self.data.strftime(self.format[0]) or “” File “/Users/iuliia_volkova2/Library/Caches/pypoetry/virtualenvs/admin-panel-service-Ji2bEy0B-py3.7/lib/python3.7/site-packages/sqlalchemy/sql/elements.py”, line 582, in bool raise TypeError(“Boolean value of this clause is not defined”) TypeError: Boolean value of this clause is not defined
Steps to reproduce the bug
I think something in model cause in issue - I send the sample
Also we use async SQLAlchemy engine. I will be glad if you will do some input where to dig or what can be a reason of the problem.
Expected behavior
Create form open correctly without issues.
Actual behavior
Impossible to open Create form
Debugging material
No response
Environment
SQLAdmin == 0.1.9 SQLAlchemy == 1.4.37
Additional context
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 20 (7 by maintainers)
problem in ‘default=func.now()’ & ‘onupdate=func.now()’ if not use ‘func.now()’ everything is ok