Comments (7)
Can you provide full exception text?
Or at least from the flask-admin?
from flask-admin.
OK, problem is in wtforms. It attempts to store default value and with new SQLAlchemy versions, it will be instance of the ColumnDefault class. Here's offending snippet::
default = getattr(column, 'default', None)
if default is not None:
# Only actually change default if it has an attribute named
# 'arg' that's callable.
callable_default = getattr(default, 'arg', None)
if callable_default and callable(callable_default):
default = callable_default(None)
I think I can override this logic, but I'm not sure what's safe way to do it.
from flask-admin.
File "E:\bin\Python27\lib\site-packages\flask\app.py", line 1518, in call
return self.wsgi_app(environ, start_response)
File "E:\bin\Python27\lib\site-packages\flask\app.py", line 1506, in wsgi_app
response = self.make_response(self.handle_exception(e))
File "E:\bin\Python27\lib\site-packages\flask\app.py", line 1504, in wsgi_app
response = self.full_dispatch_request()
File "E:\bin\Python27\lib\site-packages\flask\app.py", line 1264, in full_dispatch_request
rv = self.handle_user_exception(e)
File "E:\bin\Python27\lib\site-packages\flask\app.py", line 1262, in full_dispatch_request
rv = self.dispatch_request()
File "E:\bin\Python27\lib\site-packages\flask\app.py", line 1248, in dispatch_request
return self.view_functionsrule.endpoint
File "E:\bin\Python27\lib\site-packages\flask_admin\base.py", line 36, in inner
return f(self, *_kwargs)
File "E:\bin\Python27\lib\site-packages\flask_admin\base.py", line 36, in inner
return f(self, *_kwargs)
File "E:\bin\Python27\lib\site-packages\flask_admin\base.py", line 36, in inner
return f(self, *_kwargs)
File "E:\bin\Python27\lib\site-packages\flask_admin\model\base.py", line 742, in create_view
return_url=return_url)
File "E:\bin\Python27\lib\site-packages\flask_admin\base.py", line 169, in render
return render_template(template, *_kwargs)
File "E:\bin\Python27\lib\site-packages\flask\templating.py", line 123, in render_template
context, ctx.app)
File "E:\bin\Python27\lib\site-packages\flask\templating.py", line 107, in _render
rv = template.render(context)
File "E:\bin\Python27\lib\site-packages\jinja2\environment.py", line 894, in render
return self.environment.handle_exception(exc_info, True)
File "E:\bin\Python27\lib\site-packages\flask_admin\templates\admin\model\create.html", line 2, in top-level template code
{% import 'admin/lib.html' as lib with context %}
File "E:\bin\Python27\lib\site-packages\flask_admin\templates\admin\master.html", line 19, in top-level template code
{% block page_body %}
File "E:\bin\Python27\lib\site-packages\flask_admin\templates\admin\master.html", line 69, in block "page_body"
{% block body %}{% endblock %}
File "E:\bin\Python27\lib\site-packages\flask_admin\templates\admin\model\create.html", line 22, in block "body"
{{ lib.render_form(form, return_url, extra()) }}
File "E:\bin\Python27\lib\site-packages\flask_admin\templates\admin\lib.html", line 90, in template
{{ f() }}
File "E:\bin\Python27\lib\site-packages\wtforms\fields\core.py", line 136, in call
return self.widget(self, **kwargs)
File "E:\bin\Python27\lib\site-packages\wtforms\widgets\core.py", line 120, in call
kwargs['value'] = field._value()
File "E:\bin\Python27\lib\site-packages\wtforms\fields\core.py", line 539, in _value
return format % self.data
TypeError: a float is required
from flask-admin.
Thanks very much, flask-admin is very very very GREAT!
from flask-admin.
oh, no ,how to fix it?
from flask-admin.
This was, supposedly, fixed by https://github.com/mrjoes/flask-admin/issues/49
Reopened by accident.
from flask-admin.
@mrjoes thanks! It works!
from flask-admin.
Related Issues (20)
- Intercepting and executing custom code on object creation/update in flask-admin HOT 2
- How to use form_overrides on ListField(StringField)?
- `rediscli` command names should be treated case-insensitively
- Enhancement: Allow page_size_options = [15,30,60] to override 20,50,100 hard coded into page_size_form layout
- Error launching the examples using Python 3.12 HOT 1
- QueryAjaxModelLoader and additional filters
- Please update the requirements.txt in examples/sqla/ HOT 1
- Can't use column_filters with peewee ForeignKeyField
- aioflask with Flask>=3.0
- Form column is not being displayed if it starts with underscore "_" HOT 7
- Unable to Render Flask-Admin Edit Form Fields for Variables Stored as JSON HOT 1
- Seeking help from additional volunteers? HOT 5
- Creating custom views for BaseView grouped in a category and passing an id
- Can't use multiple `Admin` instances with different Bootstrap themes (`FLASK_ADMIN_SWATCH`) HOT 2
- Flask Admin Reboot: A community version to submit changes HOT 6
- [not issue] Implement flask-admin in Go HOT 2
- QuerySelectField ignores changes to data / default in ModelView.create_form HOT 1
- `can_set_page_size` does not prevent custom page sizes
- Multiple requests caused by 'create_modal' HOT 4
- Add Pallets-eco notice
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flask-admin.