From 24db81b3122881f71ab34142dfdde77380dafa82 Mon Sep 17 00:00:00 2001 From: Francesco Siddi Date: Thu, 19 Jun 2014 15:03:33 +0200 Subject: [PATCH] AJAX loading for admin form Backend feature to reduce load time of the blender-id list. --- blender-bfct/application/controllers/admin.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/blender-bfct/application/controllers/admin.py b/blender-bfct/application/controllers/admin.py index 4e87216..0faf11e 100644 --- a/blender-bfct/application/controllers/admin.py +++ b/blender-bfct/application/controllers/admin.py @@ -1,5 +1,5 @@ from application import app, db -from application.models.users import user_datastore +from application.models.users import user_datastore, User from application.models.applications import Application from flask import render_template, redirect, url_for @@ -51,6 +51,11 @@ class ApplicationView(CustomModelView): column_labels = {'user.first_name' : 'First Name', 'user.last_name' : 'Last Name'} column_searchable_list = ('website', 'status') can_create = False + form_ajax_refs = { + 'user': { + 'fields': (User.email, User.first_name, User.id) + } + } # Create admin