Comments (5)
I will add possibility to override field types - it is not yet supported.
But I'm not sure how it will help in your case. wtf.FileField
works with file contents and will work with LargeBinary
or other column type.
from flask-admin.
Thanks!
Ideally, I'd like to be able to extend wtf.FileField
, add my own logic to populate_obj
, and associate that with a specific field on my model. Failing that, it'd be nice to be able to create an entire form object and associate that with my model, similarly to how flask.admin handles things with model_forms
.
from flask-admin.
You can pass your own form by overriding http://flask-adminex.readthedocs.org/en/latest/mod_ext_sqlamodel/#flask.ext.adminex.ext.sqlamodel.ModelView.scaffold_form
For example::
class MyAdmin(ModelView):
def scaffold_form(self):
return MyForm
If you want to use different forms for new/edit, you can override individual methods:
http://flask-adminex.readthedocs.org/en/latest/mod_ext_sqlamodel/#flask.ext.adminex.ext.sqlamodel.ModelView.get_create_form
http://flask-adminex.readthedocs.org/en/latest/mod_ext_sqlamodel/#flask.ext.adminex.ext.sqlamodel.ModelView.get_edit_form
I will update docs to make it more clear and will add setting to override individual fields.
from flask-admin.
Update your sources, I added simplier way to force custom form:
class MyView(ModelView):
form = MyForm
from flask-admin.
This is wonderful. Thanks a ton for the quick response!
from flask-admin.
Related Issues (20)
- AttributeError: object has no attribute '_data' for composite keys
- Add Button in Flask admin page HOT 1
- Flask-admin with React HOT 1
- get_list search HOT 1
- Pop up modal custom
- Add new field and remove other when selecting element
- ItemsRequired validator AttributeError: 'QuerySelectMultipleField' object has no attribute 'entries'
- Vendored Moment.js is vulnerable to directory traversal and redos attacks HOT 2
- HTTP 500 in FileAdmin if there are broken symlinks HOT 1
- set favicon HOT 1
- not compatible with `WTForms-3.1.0` and `Babel-2.13.0` HOT 3
- Flask Admin Incompatible With Modern Flask ( >=2.3) HOT 1
- Request for Enhanced Documentation on Overriding ajax_update in Flask-Admin
- mongodb form_subdocument overwrite stopped working after updates to current flask/ flask-admin/ flask-mongoenine HOT 1
- Multiple selection from dropdown list. HOT 1
- Problem with scoped_session by sqlalchemy
- RFE: migrate from `flask-babelex` to `flask-babel`
- Bootstrap4: Duplicate requests when opening modal windows
- Intercepting and executing custom code on object creation/update in flask-admin HOT 2
- How to use form_overrides on ListField(StringField)?
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.