コード例 #1
0
def add_admin_views(admin, app):
    # Home View
    admin.add_view(HomeView(name='Home', endpoint='home'))

    # Mobile view handling
    admin.add_view(MobileLoginView(name='Mobile Login',
                                   endpoint='mobilelogin'))
    admin.add_view(MobileView(name='Mobile', endpoint='mobile'))

    # User dash view handling
    admin.add_view(
        UserDashView(name='User Portal', endpoint='userdash', app=app))
    admin.add_view(
        BusinessDashView(name='Business Portal',
                         endpoint='businessdash',
                         app=app))

    # Admin portal views
    admin.add_view(UserView(User, db.session, name='Users'))
    admin.add_view(
        HazardSummaryView(HazardSummary, db.session, name='Hazard Summary'))
    admin.add_view(
        HazardLocationView(HazardLocation, db.session,
                           name='Hazard Locations'))

    # Login and Logout views
    admin.add_view(LoginView(name='Login', endpoint='login'))
    admin.add_view(LogoutView(name='Logout', endpoint='logout'))
def add_admin_views(admin, app):
    # Home View
    admin.add_view(HomeView(name='Home', endpoint='home'))

    # User dash view handling
    admin.add_view(
        DashView(name='Real-Time Portal', endpoint='realtimeportal', app=app))
    admin.add_view(
        DashView(name='Historical Portal',
                 endpoint='historicalportal',
                 app=app))

    # Model view handling
    admin.add_view(
        StockPriceView(StockPriceDay, db.session, name='Daily Stock Prices'))
    admin.add_view(
        StockPriceView(StockPriceMinute,
                       db.session,
                       name='Minute Stock Prices'))

    # JSON Prediction View
    admin.add_view(JSONView(name='Predictions', endpoint='predictions'))

    # Admin portal views
    admin.add_view(UserView(User, db.session, name='Users'))

    # Login and Logout views
    admin.add_view(LoginView(name='Login', endpoint='login'))
    admin.add_view(LogoutView(name='Logout', endpoint='logout'))
コード例 #3
0
    def _run(self):
        self._initialize()

        root_view = RootView(self.engine)
        self.add_view('root_view', root_view)
        home_view = HomeView(self.engine)
        self.add_view('home_view', home_view)
        settings_view = SettingsView(self.engine)
        self.add_view('settings_view', settings_view)
        project_view = ProjectView(self.engine)
        self.add_view('project_view', project_view)
        template_view = TemplateView(self.engine)
        self.add_view('template_view', template_view)

        self.app.exec_()
コード例 #4
0
def home(driver):
    return HomeView(driver)
コード例 #5
0
def home(driver):
    return HomeView.instance(driver)
コード例 #6
0
 def nav_back(self):
     from views.home_view import HomeView
     self.driver.back()
     return HomeView(self.driver)
コード例 #7
0
    def index(self):
        context = {}
        view_object = HomeView('home', context)

        status = 200
        return (view_object, status)