Flask Admin - performance difficulties -
i facing performance problem in flask-admin, although performance of flask application good.
my model is:
class ck(base): __tablename__ = "ck" id = column(integer, primary_key=true, autoincrement=true) nazev = column(string(100)) kontakt = column(text) terms = relationship(term, backref=backref('ck', lazy='noload'), lazy='dynamic') class term(base): __tablename__ = "term" id = column(integer, primary_key=true, autoincrement=true) hotel_id = column(integer, foreignkey('hotel.id')) ck_id = column(integer, foreignkey('ck.id')) ... addons = relationship(addon, secondary=term_addon, backref=backref('term', lazy='noload'), lazy='dynamic') class hotel(base): __tablename__ = "hotel" id = column(integer, primary_key=true, autoincrement=true) country_id = column(integer, foreignkey('country.id')) area_id = column(integer, foreignkey('area.id')) ... photos = relationship(photo, backref=backref('hotel', lazy='select'), lazy='dynamic') terms = relationship(term, backref=backref('hotel', lazy='noload'), lazy='dynamic') class addon(base): __tablename__ = "addon" id = column(integer, primary_key=true, autoincrement=true) ...
there lot of records in terms , more in addons. if click anywhere details of hotel, term, ck or addon in flask-admin, not possible, because doesn't finish till timeout.
please advise me can improve it? thank you
enable ajax foreign key loading. see here: http://flask-admin.readthedocs.org/en/latest/api/mod_model/#flask.ext.admin.model.basemodelview.form_ajax_refs
Comments
Post a Comment