from flask_admin.form import RenderTemplateWidget
from flask_admin.contrib.peewee.form import InlineModelConverter as IMC
from flask_admin.contrib.peewee.form import InlineModelFormList as IMFL
class ShowInlineFieldListWidget(RenderTemplateWidget):
def __init__(self):
super(ShowInlineFieldListWidget, self).__init__('custom/v1/inline_field_list.html')
class ShowInlineModelFormList(IMFL):
widget = ShowInlineFieldListWidget()
def display_row_controls(self, field):return False
class ShowInlineModelConverter(IMC):
inline_field_list_type = ShowInlineModelFormList
inline_model_form_converter = ShowInlineModelConverter