Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
flask-admin
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Python-Dev
flask-admin
Commits
42966a79
Commit
42966a79
authored
Jul 05, 2015
by
Paul Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #927 from pawl/fix_WYSIWYG
fix WYSIWYG example for bootstrap3
parents
a6d6b3e4
2918eee5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
app.py
examples/wysiwyg/app.py
+8
-2
No files found.
examples/wysiwyg/app.py
View file @
42966a79
...
@@ -18,10 +18,16 @@ app.config['SQLALCHEMY_ECHO'] = True
...
@@ -18,10 +18,16 @@ app.config['SQLALCHEMY_ECHO'] = True
db
=
SQLAlchemy
(
app
)
db
=
SQLAlchemy
(
app
)
# Define wtforms widget and field
''' Define a wtforms widget and field.
WTForms documentation on custom widgets:
http://wtforms.readthedocs.org/en/latest/widgets.html#custom-widgets
'''
class
CKTextAreaWidget
(
widgets
.
TextArea
):
class
CKTextAreaWidget
(
widgets
.
TextArea
):
def
__call__
(
self
,
field
,
**
kwargs
):
def
__call__
(
self
,
field
,
**
kwargs
):
kwargs
.
setdefault
(
'class_'
,
'ckeditor'
)
# add WYSIWYG class to existing classes
existing_classes
=
kwargs
.
pop
(
'class'
,
''
)
or
kwargs
.
pop
(
'class_'
,
''
)
kwargs
[
'class'
]
=
u'
%
s
%
s'
%
(
existing_classes
,
"ckeditor"
)
return
super
(
CKTextAreaWidget
,
self
)
.
__call__
(
field
,
**
kwargs
)
return
super
(
CKTextAreaWidget
,
self
)
.
__call__
(
field
,
**
kwargs
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment