dpgaspar / Flask-AppBuilder

Simple and rapid application development framework, built on top of Flask. includes detailed security, auto CRUD generation for your models, google charts and much more. Demo (login with guest/welcome) - http://flaskappbuilder.pythonanywhere.com/
BSD 3-Clause "New" or "Revised" License
4.69k stars 1.36k forks source link

Custom add/edit widgets such as rich text editor? #908

Closed sn1p3r46 closed 5 years ago

sn1p3r46 commented 5 years ago

Hi there!

I am successfully using FAB for at least two projects! It turned out to be an amazing good choice!

Still, while I am developing I can not find/identify any snippet showing the possibility to inject custom add/edit fields such as rich text editors (e.g.: CKEditor) more or less I mean something like this. Is there any basic example out there? If no examples are available I would be glad to contribute to create a couple: a basic one and a more complex one... But first I need to understand how it works! :)

Thanks in advance and all the best, Andrea

soundmaking commented 5 years ago

Hello,

I am also hoping to include CKEditor (or similar) in an application, but because it is lower priority for me at the moment, I have installed Flask-Misaka and am rendering markdown in the templates as a quick fix.

It would be great (maybe even necessary) to provide rich text editing to the users eventually, because not all of them will be comfortable writing with markdown in the text.

dpgaspar commented 5 years ago

Hi @sn1p3r46,

Yes, FAB lacks this functionality (not a difficult one to add). But no stress, you can declare your own WTForm using your own FieldWidget ( https://github.com/dpgaspar/Flask-AppBuilder/blob/master/flask_appbuilder/fieldwidgets.py) then use ModelView properties add_form and edit_form that reference your own form.

Going to close this issue, If you find any problem related to this, just reopen it.