mirror of
https://github.com/Llloooggg/TextSouls.git
synced 2026-03-06 04:26:23 +03:00
backend+ telegram: регистрация переведена на классы
This commit is contained in:
@@ -7,4 +7,12 @@ from textsouls.models import User
|
||||
|
||||
ts_admin = Blueprint("ts_admin", __name__)
|
||||
|
||||
admin.add_view(ModelView(User, db.session))
|
||||
|
||||
class AdminView(ModelView):
|
||||
def __init__(self, model, *args, **kwargs):
|
||||
self.column_list = [c.key for c in model.__table__.columns]
|
||||
self.form_columns = self.column_list
|
||||
super(AdminView, self).__init__(model, *args, **kwargs)
|
||||
|
||||
|
||||
admin.add_view(AdminView(User, db.session))
|
||||
|
||||
Reference in New Issue
Block a user