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
4e551902
Commit
4e551902
authored
Jul 05, 2013
by
Serge S. Koval
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed #245. Filter options can now be localized
parent
698f4615
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
1 deletion
+10
-1
base.py
flask_admin/model/base.py
+6
-0
list.html
flask_admin/templates/admin/model/list.html
+1
-1
test_basic.py
flask_admin/tests/sqlamodel/test_basic.py
+3
-0
No files found.
flask_admin/model/base.py
View file @
4e551902
...
@@ -871,6 +871,12 @@ class BaseModelView(BaseView, ActionsMixin):
...
@@ -871,6 +871,12 @@ class BaseModelView(BaseView, ActionsMixin):
"""
"""
return
rec_getattr
(
model
,
name
)
return
rec_getattr
(
model
,
name
)
def
_get_filter_dict
(
self
):
"""
Return flattened filter dictionary which can be JSON-serialized.
"""
return
dict
((
unicode
(
k
),
v
)
for
k
,
v
in
self
.
_filter_dict
.
iteritems
())
@
contextfunction
@
contextfunction
def
get_list_value
(
self
,
context
,
model
,
name
):
def
get_list_value
(
self
,
context
,
model
,
name
):
"""
"""
...
...
flask_admin/templates/admin/model/list.html
View file @
4e551902
...
@@ -146,7 +146,7 @@
...
@@ -146,7 +146,7 @@
{
%
if
filter_groups
is
not
none
and
filter_data
is
not
none
%
}
{
%
if
filter_groups
is
not
none
and
filter_data
is
not
none
%
}
var
filter
=
new
AdminFilters
(
var
filter
=
new
AdminFilters
(
'#filter_form'
,
'.field-filters'
,
'#filter_form'
,
'.field-filters'
,
{{
admin_view
.
_
filter_dict
|
tojson
|
safe
}},
{{
admin_view
.
_
get_filter_dict
()
|
tojson
|
safe
}},
{{
filter_data
|
tojson
|
safe
}},
{{
filter_data
|
tojson
|
safe
}},
{{
filter_types
|
tojson
|
safe
}}
{{
filter_types
|
tojson
|
safe
}}
);
);
...
...
flask_admin/tests/sqlamodel/test_basic.py
View file @
4e551902
...
@@ -565,3 +565,6 @@ def test_default_sort():
...
@@ -565,3 +565,6 @@ def test_default_sort():
eq_
(
data
[
0
]
.
test1
,
'a'
)
eq_
(
data
[
0
]
.
test1
,
'a'
)
eq_
(
data
[
1
]
.
test1
,
'b'
)
eq_
(
data
[
1
]
.
test1
,
'b'
)
eq_
(
data
[
2
]
.
test1
,
'c'
)
eq_
(
data
[
2
]
.
test1
,
'c'
)
# TODO: Babel tests
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