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
e76fb0a3
Commit
e76fb0a3
authored
Nov 23, 2014
by
Paul Brown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use as_unicode for bootstrap3 compatibility
parent
0a31df86
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
base.py
flask_admin/model/base.py
+4
-4
No files found.
flask_admin/model/base.py
View file @
e76fb0a3
...
@@ -14,7 +14,7 @@ from flask.ext.admin.actions import ActionsMixin
...
@@ -14,7 +14,7 @@ from flask.ext.admin.actions import ActionsMixin
from
flask.ext.admin.helpers
import
get_form_data
,
validate_form_on_submit
,
get_redirect_target
from
flask.ext.admin.helpers
import
get_form_data
,
validate_form_on_submit
,
get_redirect_target
from
flask.ext.admin.tools
import
rec_getattr
from
flask.ext.admin.tools
import
rec_getattr
from
flask.ext.admin._backwards
import
ObsoleteAttr
from
flask.ext.admin._backwards
import
ObsoleteAttr
from
flask.ext.admin._compat
import
iteritems
,
OrderedDict
from
flask.ext.admin._compat
import
iteritems
,
OrderedDict
,
as_unicode
from
.helpers
import
prettify_name
,
get_mdict_item_or_list
from
.helpers
import
prettify_name
,
get_mdict_item_or_list
from
.ajax
import
AjaxModelLoader
from
.ajax
import
AjaxModelLoader
...
@@ -594,7 +594,7 @@ class BaseModelView(BaseView, ActionsMixin):
...
@@ -594,7 +594,7 @@ class BaseModelView(BaseView, ActionsMixin):
self
.
_filter_groups
[
flt
.
name
]
.
append
({
self
.
_filter_groups
[
flt
.
name
]
.
append
({
'index'
:
i
,
'index'
:
i
,
'arg'
:
self
.
get_filter_arg
(
i
,
flt
),
'arg'
:
self
.
get_filter_arg
(
i
,
flt
),
'operation'
:
unicode
(
flt
.
operation
()),
'operation'
:
as_
unicode
(
flt
.
operation
()),
'options'
:
flt
.
get_options
(
self
)
or
None
,
'options'
:
flt
.
get_options
(
self
)
or
None
,
'type'
:
flt
.
data_type
'type'
:
flt
.
data_type
})
})
...
@@ -809,7 +809,7 @@ class BaseModelView(BaseView, ActionsMixin):
...
@@ -809,7 +809,7 @@ class BaseModelView(BaseView, ActionsMixin):
Filter instance
Filter instance
"""
"""
if
self
.
named_filter_urls
:
if
self
.
named_filter_urls
:
name
=
(
'
%
s
%
s'
%
(
flt
.
name
,
unicode
(
flt
.
operation
())))
.
lower
()
name
=
(
'
%
s
%
s'
%
(
flt
.
name
,
as_
unicode
(
flt
.
operation
())))
.
lower
()
name
=
filter_char_re
.
sub
(
''
,
name
)
name
=
filter_char_re
.
sub
(
''
,
name
)
name
=
filter_compact_re
.
sub
(
'_'
,
name
)
name
=
filter_compact_re
.
sub
(
'_'
,
name
)
return
name
return
name
...
@@ -945,7 +945,7 @@ class BaseModelView(BaseView, ActionsMixin):
...
@@ -945,7 +945,7 @@ class BaseModelView(BaseView, ActionsMixin):
# Exception handler
# Exception handler
def
handle_view_exception
(
self
,
exc
):
def
handle_view_exception
(
self
,
exc
):
if
isinstance
(
exc
,
ValidationError
):
if
isinstance
(
exc
,
ValidationError
):
flash
(
unicode
(
exc
))
flash
(
as_
unicode
(
exc
))
return
True
return
True
if
self
.
_debug
:
if
self
.
_debug
:
...
...
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