<s> from flask import current_app <EOL> from flask_admin . contrib . fileadmin import FileAdmin <EOL> from flask_admin import AdminIndexView , expose , Admin <EOL> from flask_admin . contrib . sqla import ModelView <EOL> from atomicpress import models <EOL> from atomicpress . app import db <EOL> class HomeView ( AdminIndexView ) : <EOL> @ expose ( "<STR_LIT:/>" ) <EOL> def index ( self ) : <EOL> return self . render ( '<STR_LIT>' ) <EOL> class PostView ( ModelView ) : <EOL> column_default_sort = ( '<STR_LIT:date>' , True ) <EOL> column_searchable_list = ( '<STR_LIT:name>' , '<STR_LIT:title>' , '<STR_LIT:content>' ) <EOL> column_list = ( '<STR_LIT:title>' , '<STR_LIT:status>' , '<STR_LIT>' , '<STR_LIT:date>' , '<STR_LIT:type>' ) <EOL> def create_admin ( ) : <EOL> app = current_app . _get_current_object ( ) <EOL> admin = Admin ( app , "<STR_LIT>" , index_view = HomeView ( name = '<STR_LIT>' ) ) <EOL> admin . add_view ( ModelView ( models . Blog , db . session , category = "<STR_LIT>" ) ) <EOL> admin . add_view ( ModelView ( models . Author , db . session , category = "<STR_LIT>" ) ) <EOL> admin . add_view ( PostView ( models . Post , db . session , category = "<STR_LIT>" ) ) <EOL> admin . add_view ( ModelView ( models . Tag , db . session , category = "<STR_LIT>" ) ) <EOL> admin . add_view ( ModelView ( models . Category , db . session , category = "<STR_LIT>" ) ) <EOL> admin . add_view ( FileAdmin ( app . config [ "<STR_LIT>" ] , <EOL> app . config [ "<STR_LIT>" ] , <EOL> name = '<STR_LIT>' ) ) </s>
