Commit a8495930 authored by Serge S. Koval's avatar Serge S. Koval

Merged with master

parents 83ec5be7 6150104f
......@@ -111,6 +111,7 @@ class BaseView(with_metaclass(AdminViewMeta, BaseViewClass)):
Derive from this class to implement your administrative interface piece. For example::
from flask.ext.admin import BaseView, expose
class MyView(BaseView):
@expose('/')
def index(self):
......
......@@ -749,8 +749,8 @@ class ModelView(BaseModelView):
if self._search_joins:
for table in self._search_joins:
if table.name not in joins:
query = query.join(table)
count_query = count_query.join(table)
query = query.outerjoin(table)
count_query = count_query.outerjoin(table)
joins.add(table.name)
......
......@@ -60,7 +60,7 @@
<form class="icon" method="POST" action="{{ get_url('.delete') }}">
<input type="hidden" name="path" value="{{ path }}"></input>
<button onclick="return confirm('{{ _gettext('Are you sure you want to delete \\\'%(name)s\\\' recursively?', name=name) }}')">
<i class="icon-remove"></i>
<i class="glyphicon glyphicon-remove"></i>
</button>
</form>
{% endif %}
......
......@@ -11,7 +11,7 @@
</div>
{% else %}
<div class="inline-field-control">
<a href="javascript:void(0)" class="inline-remove-field"><i class="icon-remove"></i></a>
<a href="javascript:void(0)" class="inline-remove-field"><i class="glyphicon glyphicon-remove"></i></a>
</div>
{% endif %}
{%- endif -%}
......
......@@ -246,6 +246,26 @@ def test_complex_searchable_list():
ok_('model3' not in data)
def test_complex_searchable_list_missing_children():
app, db, admin = setup()
Model1, Model2 = create_models(db)
view = CustomModelView(Model1, db.session,
column_searchable_list=[
'test1', 'model2.string_field'])
admin.add_view(view)
db.session.add(Model1('magic string'))
db.session.commit()
client = app.test_client()
rv = client.get('/admin/model1/?search=magic')
data = rv.data.decode('utf-8')
ok_('magic string' in data)
def test_column_filters():
app, db, admin = setup()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment