Actually bind flask-admin to the mail servers

This commit is contained in:
Pierre Jaury
2016-02-20 20:11:59 +01:00
parent 61c99c7014
commit 48fbf737ce
13 changed files with 98 additions and 27 deletions

View File

@@ -8,15 +8,24 @@ from freeposte import app, db, models
admin = admin.Admin(app, name='Freeposte.io', template_mode='bootstrap3')
class DomainModelView(sqla.ModelView):
class BaseModelView(sqla.ModelView):
def after_model_change(self, form, model, is_created):
db.session.commit()
def after_model_delete(self, model):
db.session.commit()
class DomainModelView(BaseModelView):
pass
class UserModelView(sqla.ModelView):
class UserModelView(BaseModelView):
pass
class AliasModelView(sqla.ModelView):
class AliasModelView(BaseModelView):
pass