Commit 2b471737 authored by Serge S. Koval's avatar Serge S. Koval

Merge branch 'master' of github.com:mrjoes/flask-admin

parents 2348cf2f c8132741
......@@ -171,7 +171,7 @@ class InlineModelConverter(InlineModelConverterBase):
attrs = dict()
for attr in dir(p):
if not attr.startswith('_') and attr != model:
if not attr.startswith('_') and attr != 'model':
attrs[attr] = getattr(p, attr)
info = InlineFormAdmin(model, **attrs)
......
......@@ -24,6 +24,10 @@ class Unique(object):
self.message = message
def __call__(self, form, field):
# databases allow multiple NULL values for unique columns
if field.data is None:
return
try:
obj = (self.db_session.query(self.model)
.filter(self.column == field.data)
......
......@@ -178,7 +178,7 @@ class FileUploadField(fields.TextField):
return ('.' in filename and
filename.rsplit('.', 1)[1].lower() in
map(str.lower, self.allowed_extensions))
map(lambda x: x.lower(), self.allowed_extensions))
def pre_validate(self, form):
if (self.data and
......
......@@ -1272,7 +1272,7 @@ class BaseModelView(BaseView, ActionsMixin):
return redirect(return_url)
form_opts = FormOpts(widget_args=self.form_widget_args,
form_rules=self._form_create_rules)
form_rules=self._form_edit_rules)
return self.render(self.edit_template,
model=model,
......
......@@ -31,6 +31,10 @@ form.search-form .clear i {
margin: 2px 0 0 0;
}
form.search-form div input {
margin: 0;
}
/* Filters */
table.filters {
border-collapse: collapse;
......@@ -108,4 +112,4 @@ table.filters {
.list-checkbox-column {
width: 14px;
}
\ No newline at end of file
}
......@@ -189,6 +189,10 @@ msgstr "Уже существует."
msgid "Model was successfully created."
msgstr "Запись была создана."
#: ../flask_admin/model/base.py:1268
msgid "Model was successfully saved."
msgstr "Запись была сохранена."
#: ../flask_admin/model/filters.py:82
msgid "Yes"
msgstr "Да"
......
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