Ejemplo n.º 1
0
    @expose("/method1/")
    @has_access
    def method1(self):
        # do something with param1
        # and return to previous page or index
        return "Hello"

    @expose("/method2/<string:param1>")
    @has_access
    def method2(self, param1):
        # do something with param1
        # and render template with param
        param1 = "Goodbye %s" % (param1)
        return param1

    @expose("/method3/<string:param1>")
    @has_access
    def method3(self, param1):
        # do something with param1
        # and render template with param
        param1 = "Goodbye %s" % (param1)
        return render_template("method3.html", param1=param1, appbuilder=self.appbuilder)


appbuilder.add_view(MyView(), "Method1", category="My View")
# appbuilder.add_view(MyView(), "Method2", href='/myview/method2/jonh', category='My View')
# Use add link instead there is no need to create MyView twice.
appbuilder.add_link("Method2", href="/myview/method2/jonh", category="My View")
appbuilder.add_link("Method3", href="/myview/method3/jonh", category="My View")
Ejemplo n.º 2
0
appbuilder.add_view(CountryDirectChartView,
                    "Direct Chart Example",
                    icon="fa-bar-chart-o",
                    label=_('Direct Chart Example'),
                    category="Chart Examples")
appbuilder.add_view(MasterGroupByChartView,
                    "Master Chart Example",
                    icon="fa-bar-chart-o",
                    label=_('Master Detail Chart Example'),
                    category="Chart Examples")
appbuilder.add_view(CountryGroupByChartView,
                    "Group By Chart Example",
                    icon="fa-bar-chart-o",
                    label=_('Group By Chart Example'),
                    category="Chart Examples")
appbuilder.add_view(CountryPieGroupByChartView,
                    "Group By Pie Chart Example",
                    icon="fa-bar-chart-o",
                    label=_('Group By Pie Chart Example'),
                    category="Chart Examples")

appbuilder.add_view(NewsView, 'News', category="News-Finance")

appbuilder.add_link("Live News",
                    href="/newsview/live_news/",
                    category="News-Finance")

appbuilder.add_link("google",
                    href="http://www.google.com",
                    icon="fa-google-plus")
Ejemplo n.º 3
0
"""


class MyView(BaseView):
    default_view = 'hello'

    @expose('/message/<string:msg>')
    @has_access
    def message(self, msg):
        msg = 'Hello %s' % (msg)
        return msg
        return self.render_template('index.html', msg=msg)


appbuilder.add_link("Welcome",
                    href='/myview/welcome/student',
                    category='My View')


# create the contact Model view
class ContactModelView(ModelView):
    datamodel = SQLAInterface(Contact)

    label_columns = {'contact_group': 'Contacts Group'}
    list_columns = ['name', 'personal_cellphone', 'birthday', 'contact_group']

    show_fieldsets = [
        ('Summary', {
            'fields': ['name', 'address', 'contact_group']
        }),
        ('Personal Info', {
Ejemplo n.º 4
0
    @has_access
    def method1(self):
            # do something with param1
            # and return to previous page or index
        return 'Hello'

    @expose('/method2/<string:param1>')
    @has_access
    def method2(self, param1):
        # do something with param1
        # and render template with param
        param1 = 'Goodbye %s' % (param1)
        return param1

    @expose('/method3/<string:param1>')
    @has_access
    def method3(self, param1):
        # do something with param1
        # and render template with param
        param1 = 'Goodbye %s' % (param1)
        return self.render_template('method3.html',
                               param1=param1)


appbuilder.add_view(MyView(), "Method1", category='My View')
#appbuilder.add_view(MyView(), "Method2", href='/myview/method2/jonh', category='My View')
# Use add link instead there is no need to create MyView twice.
appbuilder.add_link("Method2", href='/myview/method2/jonh', category='My View')
appbuilder.add_link("Method3", href='/myview/method3/jonh', category='My View')

Ejemplo n.º 5
0
        # and render template with param
        param1 = 'Goodbye %s' % (param1)
        return param1

    @expose('/method3/<string:param1>')
    @has_access
    def method3(self, param1):
        # do something with param1
        # and render template with param
        param1 = 'Goodbye %s' % (param1)
        self.update_redirect()
        return self.render_template('method3.html', param1=param1)


appbuilder.add_view(MyView, "Method1", category='My View')
appbuilder.add_link("Method2", href='/myview/method2/john', category='My View')
appbuilder.add_link("Method3", href='/myview/method3/john', category='My View')

# # show swagger in toolbar
# class SwaggerView(BaseView):

#     default_view = 'swagger'

#     @expose('/swagger/')
#     @has_access
#     def swagger(self):
#         # do something with param1
#         # and return to previous page or index
#         return 'Hello'

# appbuilder.add_view(SwaggerView, "Swagger Spec", category='Swagger')
Ejemplo n.º 6
0
        for x in results:
            y[x.cid] = x.areaname
            k[x.kid] = x.dname
            z['area'] = y
            z['delgate'] = k
        return z


db.create_all()

appbuilder.add_view_no_menu(Sms())
appbuilder.add_view_no_menu(MyView())
appbuilder.add_view_no_menu(API())

appbuilder.add_view(VotersView, "Voters", category="Settings")
appbuilder.add_view(DelegatesView, "Delegates", category="Settings")
appbuilder.add_view(ElectionView, "Elections", category="Settings")
appbuilder.add_view(ScopeView, " Scopes", category="Settings")
appbuilder.add_view(PostView, " Post", category="Settings")
appbuilder.add_view(CountiesView, "Counties", category="Settings")
appbuilder.add_view(ConstituencyView, "Constituency", category="Settings")
appbuilder.add_view(WardView, "Ward", category="Settings")
appbuilder.add_view(SmsloggerView, "SMS LOGGER", category="Settings")
appbuilder.add_view(VotersChartView, "Voters Registered", category="Reports")
appbuilder.add_view(SMSReportChartView, "SMS Report", category="Reports")
# appbuilder.add_view(MyView, "Election Results", category="Reports")

appbuilder.add_link("Election Results",
                    href='/election/result',
                    category='Reports')
Ejemplo n.º 7
0
                "[" + cluster.cluster_name + "]",
                'info')
        session.commit()
        return redirect("/datasourcemodelview/list/")

    @expose("/autocomplete/<datasource>/<column>/")
    def autocomplete(self, datasource, column):
        client = utils.get_pydruid_client()
        top = client.topn(
            datasource=datasource,
            granularity='all',
            intervals='2013-10-04/2020-10-10',
            aggregations={"count": doublesum("count")},
            dimension=column,
            metric='count',
            threshold=1000,
        )
        values = sorted([d[column] for d in top[0]['result']])
        return json.dumps(values)

appbuilder.add_view_no_menu(Panoramix)
appbuilder.add_link(
    "Refresh Druid Metadata",
    href='/panoramix/refresh_datasources/',
    category='Admin',
    category_icon='fa-cogs',
    icon="fa-cog")

#models.Metric.__table__.drop(db.engine)
db.create_all()
Ejemplo n.º 8
0
            # do something with param1
            # and return to previous page or index
        return 'Hello'

    @expose('/method2/<string:param1>')
    @has_access
    def method2(self, param1):
        # do something with param1
        # and render template with param
        param1 = 'Goodbye %s' % (param1)
        return param1

    @expose('/method3/<string:param1>')
    @has_access
    def method3(self, param1):
        # do something with param1
        # and render template with param
        param1 = 'Goodbye %s' % (param1)
        return render_template('method3.html',
                               param1 = param1,
                               appbuilder=self.appbuilder)



appbuilder.add_view(MyView(), "Method1", category='My View')
#appbuilder.add_view(MyView(), "Method2", href='/myview/method2/jonh', category='My View')
# Use add link instead there is no need to create MyView twice.
appbuilder.add_link("Method2", href='/myview/method2/jonh', category='My View')
appbuilder.add_link("Method3", href='/myview/method3/jonh', category='My View')

Ejemplo n.º 9
0
                    icon="fa-users")  #, category_icon="fa-envelope")
appbuilder.add_view(SidebarModuleView,
                    "Sidebar",
                    category="Blog",
                    icon="fa-bars")  #, category_icon="fa-envelope")

# Category 'Config'
appbuilder.add_view(ChooseConfigView,
                    "Choose",
                    category="Config",
                    icon="fa-location-arrow",
                    category_icon="fa-tachometer")
appbuilder.add_view(BlogConfigView,
                    "Configs",
                    category="Config",
                    icon="fa-list-alt")  #, category_icon="fa-envelope")

appbuilder.add_link("Public",
                    href='/home',
                    category="Home",
                    icon="fa-eye",
                    category_icon="fa-home")
appbuilder.add_link("Preview",
                    href='/preview/home',
                    category="Home",
                    icon="fa-eye-slash")

# Make the ``PrivateView`` private
import permissions
permissions.make_public(PublicView)
Ejemplo n.º 10
0
        list_columns = [
            'img', 'models', 'iPhonesize', 'chip', 'wifi', 'USB_type'
        ]
        return self.render_template('iphone.html',
                                    datas=datas,
                                    list_columns=list_columns)


db.create_all()
""" Page View """

# appbuilder.add_view(Register, 'Register', category="Sam")

appbuilder.add_view(mac, 'MacBook Air', category="Mac")
appbuilder.add_link("MacBook Pro 13 inch",
                    href="/mac/MacBook_Pro_13/",
                    category="Mac")
appbuilder.add_link("MacBook Pro 16 inch",
                    href="/mac/MacBook_Pro_16/",
                    category="Mac")

appbuilder.add_view(iphone, "iphone12 Pro", category='iPhone')
appbuilder.add_link("iphone12", href="/iphone/iphone12/", category="iPhone")
appbuilder.add_link("iphone11", href="/iphone/iphone11/", category="iPhone")
appbuilder.add_link("iphoneSE", href="/iphone/iphoneSE/", category="iPhone")

appbuilder.add_view(ipad, 'iPad Pro', category="iPad")
appbuilder.add_link("iPad Air", href="/ipad/iPadAir/", category="iPad")
appbuilder.add_link("iPad", href="/ipad/iPad/", category="iPad")
appbuilder.add_link("iPadmini", href="/ipad/iPadmini/", category="iPad")
Ejemplo n.º 11
0
    @expose('/method1/')
    @has_access
    def method1(self):
        # do something with param1
        # and return to previous page or index
        return 'Hello'

    @expose('/method2/<string:param1>')
    @has_access
    def method2(self, param1):
        # do something with param1
        # and render template with param
        param1 = 'Goodbye %s' % (param1)
        return param1

    # from flask import render_template

    @expose('/method3/<string:param1>')
    @has_access
    def method3(self, param1):
        # do something with param1
        # and render template with param
        param1 = 'Goodbye %s' % (param1)
        self.update_redirect()
        return self.render_template('method3.html', param1=param1)


appbuilder.add_view(MyView, "方法1", category='导航栏')
appbuilder.add_link("方法2", href='/myview/method2/john', category='导航栏')
appbuilder.add_link("方法3", href='/myview/method3/john', category='导航栏')
Ejemplo n.º 12
0
                    category_icon='fa-envelope')
appbuilder.add_view(CategoryView,
                    "Category",
                    icon="fa-folder-open-o",
                    category="Setting",
                    category_icon='fa-envelope')
appbuilder.add_separator(category='Setting')
appbuilder.add_view(Setting_updateView,
                    "Setting Update",
                    icon="fa-folder-open-o",
                    category="Setting",
                    category_icon='fa-envelope')

appbuilder.add_link('Document Code Error',
                    '/documentlistview/list/?_flt_0_note=Document+Code+Error',
                    icon="fa-folder-open-o",
                    category="DCC Check",
                    category_icon='fa-envelope')
appbuilder.add_link('PDB Not in Document List',
                    '/pdbview/list/?_flt_0_client_reference=__None',
                    icon="fa-folder-open-o",
                    category="DCC Check",
                    category_icon='fa-envelope')
appbuilder.add_link('Janus Not in Document List',
                    '/janusview/list/?_flt_0_client_reference=__None',
                    icon="fa-folder-open-o",
                    category="DCC Check",
                    category_icon='fa-envelope')
# document_list_upload()
# janus_upload()
# pdb_list_upload()
        param1 = 'My HKBN App'
        self.update_redirect()
        return self.render_template('myhkbnapp.html', param1=param1)

    @expose('/customersupport/')
    def voicecalls(self):
        param1 = 'Customer Support'
        self.update_redirect()
        return self.render_template('customersupport.html', param1=param1)


db.create_all()
""" Page View """
appbuilder.add_view(ADboardView, 'local_news', category="News")
appbuilder.add_link("Global News",
                    href="/adboardview/global_news/",
                    category="News")
appbuilder.add_view(ServiceView, 'fibrebroadband', category="Service")
appbuilder.add_link("Smart Home",
                    href="/serviceview/smarthome/",
                    category="Service")
appbuilder.add_link("Voice Calls",
                    href="/serviceview/voicecalls/",
                    category="Service")
""" Custom Views """
appbuilder.add_view(MenuItemView,
                    "MenuItem",
                    icon="fa-folder-open-o",
                    category="Admin")
appbuilder.add_view(MenuCategoryView,
                    "MenuCategory",
Ejemplo n.º 14
0
                "Refreshed metadata from cluster "
                "[" + cluster.cluster_name + "]", 'info')
        session.commit()
        return redirect("/datasourcemodelview/list/")

    @expose("/autocomplete/<datasource>/<column>/")
    def autocomplete(self, datasource, column):
        client = utils.get_pydruid_client()
        top = client.topn(
            datasource=datasource,
            granularity='all',
            intervals='2013-10-04/2020-10-10',
            aggregations={"count": doublesum("count")},
            dimension=column,
            metric='count',
            threshold=1000,
        )
        values = sorted([d[column] for d in top[0]['result']])
        return json.dumps(values)


appbuilder.add_view_no_menu(Panoramix)
appbuilder.add_link("Refresh Druid Metadata",
                    href='/panoramix/refresh_datasources/',
                    category='Admin',
                    category_icon='fa-cogs',
                    icon="fa-cog")

#models.Metric.__table__.drop(db.engine)
db.create_all()
Ejemplo n.º 15
0
class MyFormView(SimpleFormView):
    form = MyForm
    form_title = 'This is my first form view'
    message = 'My form submitted'

    def form_get(self, form):
        form.field1.data = 'This was prefilled'

    def form_post(self, form):
        # post process form
        flash(self.message, 'info')


#appbuilder.add_view_no_menu(MyView())
appbuilder.add_view(MyView, "Method1", category='My View')
appbuilder.add_link("Method2", href='/myview/method2/john', category='My View')
appbuilder.add_link("Method3", href='/myview/method3/john', category='My View')
appbuilder.add_view(MyFormView,
                    "My form View",
                    icon="fa-group",
                    label=_('My form View'),
                    category="My Forms",
                    category_icon="fa-cogs")


class BS3TextFieldROWidget(BS3TextFieldWidget):
    def __call__(self, field, **kwargs):
        kwargs['readonly'] = 'true'
        return super(BS3TextFieldROWidget, self).__call__(field, **kwargs)

Ejemplo n.º 16
0
                    icon="fa-folder-open-o",
                    category="Administration",
                    category_icon='fa-envelope')
appbuilder.add_view(Project_QAView,
                    "List ProjectQA",
                    icon="fa-folder-open-o",
                    category="Administration",
                    category_icon='fa-envelope')

# appbuilder.add_view(ContactModelView, "List Contacts", icon="fa-envelope", category="Administration")
appbuilder.add_separator("Administration")

appbuilder.add_view(MyView(), "Method1", category='My View')
#appbuilder.add_view(MyView(), "Method2", href='/myview/method2/jonh', category='My View')
# Use add link instead there is no need to create MyView twice.
appbuilder.add_link("Method2", href='/myview/method2/jonh', category='My View')
appbuilder.add_link("Method3", href='/myview/method3/jonh', category='My View')
appbuilder.add_link("send_email",
                    href='/myview/send_email/jonh',
                    category='My View')
appbuilder.add_link("send_email_view",
                    href='/myview/send_email/jonh',
                    category='My View')
"""
    Application wide 404 error handler
"""


@appbuilder.app.errorhandler(404)
def page_not_found(e):
    return render_template('404.html',
Ejemplo n.º 17
0
    def get_expenses(self):
        sObj = Splitwise(Config.consumer_key, Config.consumer_secret)
        sObj.setAccessToken(session['access_token'])
        content = sObj.getExpenses()
        session['expenses'] = content

        friends = sObj.getFriends()
        self.debtors = friendsload(friends)
        #print(friendsload(friends))
        #print("\n\n\n\n\n\n" , content)
        #resp = splitwise.get('get_current_user')
        return render2('output.html', getresp="waddup")


# class Root(BaseView):

# appbuilder.add_view_no_menu(Splitwise())
appbuilder.add_view_no_menu(Starling())
appbuilder.add_view_no_menu(Home())

#appbuilder.add_view(Welcome, "Welcome", category='Charts')
# appbuilder.add_view(Home, "/home/home")
appbuilder.add_link("Settle", "/home/settle", label="Settle")
appbuilder.add_link("Analytics", "/home/balance", label="Analytics")
appbuilder.add_link("Transactions", "/home/home", label="Transactions")
# appbuilder.add_view_no_menu(Welcome())
# appbuilder.add_link("Splitwise", href='/splitwise_login/', category='Login')
# appbuilder.add_view(Home, '/balance', category="Analytics")

db.create_all()
Ejemplo n.º 18
0
        response = requests.request("GET", url)
        data = json.loads(response.text)
        ult_list = ast.literal_eval(json.dumps(data))
        return self.render_template('output.html', ult_list=ult_list)


db.create_all()
fill_gender()
appbuilder.add_view(GroupLocationView,
                    "List Location",
                    icon="fa-envelope ",
                    category="Menu")
appbuilder.add_view(EmployeeModelView,
                    "Add Employee",
                    icon="fa-envelope ",
                    category="Menu")

appbuilder.add_view_no_menu(MyView())
appbuilder.add_link("Expose Employee",
                    href='/api/vi/empdataa',
                    icon="fa-folder-open-o",
                    category='Menu')
appbuilder.add_link("List Bangalore Employee",
                    href='/api/vi/getdata_b',
                    icon="fa-envelope ",
                    category='Menu')
appbuilder.add_link("List Chennai Employee",
                    href='/api/vi/getdata_c',
                    icon="fa-envelope ",
                    category='Menu')
Ejemplo n.º 19
0
        param1 = "learning center"
        self.update_redirect()
        return self.render_template("learning center.html", param1=param1)

    @expose("/Xamarin/")
    def Xamarin(self):
        param1 = "Xamarin"
        self.update_redirect()
        return self.render_template("Xamarin.html", param1=param1)


db.create_all()
""" Page View """
appbuilder.add_view(NewsPageView, 'Local News', category="News")
appbuilder.add_link("Global News",
                    href="/newspageview/global_news/",
                    category="News")

appbuilder.add_view(MicrosoftView,
                    "learning center",
                    category="Learning center")
appbuilder.add_link("Xamarin",
                    href="/microsoftview/Xamarin/",
                    category="Learning center")
""" Custom Views """
appbuilder.add_view(MenuItemView,
                    "MenuItem",
                    icon="fa-folder-open-o",
                    category="Admin")
appbuilder.add_view(MenuCategoryView,
                    "MenuCategory",
Ejemplo n.º 20
0

class project_users(ModelView):
    datamodel = SQLAInterface(project_users_model)


db.create_all()


################## Tab Menu : Project ##################
appbuilder.add_view(projects, "Projects", icon="fa-folder-open", category="Resource_Providers")
appbuilder.add_view(resources, "Resources", icon="fa-folder-open-o", category="Resource_Providers")
appbuilder.add_view(project_users, "project_users", icon="fa-folder-open", category="Resource_Providers")
appbuilder.add_view(resources_availability,'resAvail', icon="fa-folder-open-o", category="Resource_Providers")
appbuilder.add_view(resources_booking,'resBooking', icon="fa-folder-open-o", category="Resource_Providers")


################## Tab Menu : Check ##################
appbuilder.add_view(project, "Projects", href='/project/all', category='stakeholders')
# appbuilder.add_view(project, "Summary", href='/project/summary/12', category='stakeholders') # internal
# appbuilder.add_link("Availability", href='/project/availability/001', category='stakeholders') # internal
# appbuilder.add_link("Bookings", href='/project/bookings/001', category='stakeholders') # internal
appbuilder.add_link("Help", href='/project/help/', category='Help')
appbuilder.add_link("Test", href='/project/test/', category='Test')
appbuilder.add_link("Method4", href='/project/method4/12', category='stakeholders')
appbuilder.add_link("Method5", href='/project/method5', category='stakeholders')




Ejemplo n.º 21
0
appbuilder.add_view(ContactTimeChartView,
                    "Contacts Birth Chart",
                    icon="fa-dashboard",
                    category="Contacts")

appbuilder.add_view(ProductManufacturerView,
                    "List Manufacturer",
                    icon="fa-folder-open-o",
                    category="Products",
                    category_icon='fa-envelope')
appbuilder.add_view(ProductModelView,
                    "List Models",
                    icon="fa-envelope",
                    category="Products")
appbuilder.add_view(ProductView,
                    "List Products",
                    icon="fa-envelope",
                    category="Products")
appbuilder.add_link("ContacModelView_lnk",
                    "ContactModelView.add",
                    icon="fa-envelope",
                    label="Add Contact")
appbuilder.add_view(TestForm,
                    "My form View",
                    icon="fa-group",
                    label='My Test form')
appbuilder.add_view(PostTweet, "Tweet", icon="fa-twitter", label='Tweet')

appbuilder.add_link("Index", "MyIndexView.index")
appbuilder.security_cleanup()
Ejemplo n.º 22
0
#     def form_get(self, form):
#         form.todo.data = ''

#     def form_post(self, form):
#         # post process form

#         flash(self.message, 'info')


# appbuilder.add_view(AddTodo, "AddTodo", icon="fa-group", label=_('Add Todo'),
#                      category="Add Todo", category_icon="fa-cogs")

db.create_all()
appbuilder.add_view(AddTodoModelView,
                    "Todos",
                    category = "Todos")            
appbuilder.add_view(Home(), "Home", category='Home')
# Use add link instead there is no need to create MyView twice.
appbuilder.add_link("About", href='/home/about', category='About')

"""
    Application wide 404 error handler
"""

@appbuilder.app.errorhandler(404)
def page_not_found(e):
    return render_template('404.html', base_template=appbuilder.base_template, appbuilder=appbuilder), 404


db.create_all()
Ejemplo n.º 23
0
class EventGroupModelView(ModelView):
    datamodel = SQLAInterface(EventGroup)
    related_views = [MovieModelView]


class JoinUsModelView(ModelView):
    datamodel = SQLAInterface(JoinUs)
    list_columns = ['id', 'job', 'job_description', 'requirments', 'Benefits', 'remark']


db.create_all()

""" Cinemas Page View """
appbuilder.add_view(CinemasPageView, 'MOViE MOViE Cityplaza', icon="fa fa-map-marker", category="Cinemas",
                    category_icon='fa fa-location-arrow')
appbuilder.add_link("PALACE ifc", icon="fa fa-map-marker", href="/cinemaspageview/PALACE_ifc/", category="Cinemas")
appbuilder.add_link("CYBERPORT", icon="fa fa-map-marker", href="/cinemaspageview/CYBERPORT/", category="Cinemas")
appbuilder.add_link("PREMIERE ELEMENTS", icon="fa fa-map-marker", href="/cinemaspageview/PREMIERE_ELEMENTS/",
                    category="Cinemas")
appbuilder.add_link("HOLLYWOOD", icon="fa fa-map-marker", href="/cinemaspageview/HOLLYWOOD/", category="Cinemas")
appbuilder.add_link("The ONE", icon="fa fa-map-marker", href="/cinemaspageview/The_ONE/", category="Cinemas")
appbuilder.add_link("CINEMATHEQUE", icon="fa fa-map-marker", href="/cinemaspageview/CINEMATHEQUE/",
                    category="Cinemas")
appbuilder.add_link("MONGKOK", icon="fa fa-map-marker", href="/cinemaspageview/MONGKOK/", category="Cinemas")
appbuilder.add_link("PALACE apm", icon="fa fa-map-marker", href="/cinemaspageview/PALACE_apm/", category="Cinemas")
appbuilder.add_link("MY CINEMA YOHO MALL", icon="fa fa-map-marker", href="/cinemaspageview/MY_CINEMA_YOHO_MALL/",
                    category="Cinemas")
appbuilder.add_link("KWAI FONG", icon="fa fa-map-marker", href="/cinemaspageview/KWAI_FONG/", category="Cinemas")
appbuilder.add_link("TSUEN WAN", icon="fa fa-map-marker", href="/cinemaspageview/TSUEN_WAN/", category="Cinemas")
appbuilder.add_link("KINGSWOOD GINZA", icon="fa fa-map-marker", href="/cinemaspageview/KINGSWOOD_GINZA/",
                    category="Cinemas")
Ejemplo n.º 24
0
    datamodel = SQLAInterface(Menu5)
    list_columns = ['id', 'title']

class Menu6View(ModelView):
    datamodel = SQLAInterface(Menu6)
    list_columns = ['id', 'title']
    
class CinemamovieView(ModelView):
    datamodel = SQLAInterface(Cinemamovie)
    list_columns = ['id', 'cinema', 'moviename1']
    
db.create_all()

""" Page View """
appbuilder.add_view(menuView, 'Ticketing', category="Menu")
appbuilder.add_link("Comming soon", href="/menuview/coomingsoon/", category="Menu")
appbuilder.add_link("Festival & Programes", href="/menuview/festandpro/", category="Menu")
appbuilder.add_link("Promotions & News", href="/menuview/proandnews/", category="Menu")
appbuilder.add_link("Events", href="/menuview/events/", category="Menu")
appbuilder.add_link("Screen AD", href="/menuview/screen/", category="Menu")
appbuilder.add_view(cinemaareaView, 'K11 Art House', category="Cinemaarea")
appbuilder.add_link("Bea Festival Suite", href="/cinemaareaview/beafestival/", category="Cinemaarea")
appbuilder.add_link("Windsor", href="/cinemaareaview/windsor/", category="Cinemaarea")
appbuilder.add_view(menu99View, 'About Us', category="More")
appbuilder.add_link("Contact us", href="/menu99view/contactus/", category="More")
appbuilder.add_link("Career", href="/menu99view/career/", category="More")
appbuilder.add_link("FAQ", href="/menu99view/faq/", category="More")
appbuilder.add_link("Personal Information Collection Statement", href="/menu99view/personalinf/", category="More")
appbuilder.add_link("Privacy Policy Statement", href="/menu99view/privacypolicy/", category="More")
appbuilder.add_link("Term Of Use", href="/menu99view/termofuse/", category="More")
Ejemplo n.º 25
0
#          ADD VIEWS FOR ANALYTICS


appbuilder.add_view(DatascienceView,
                    'Election analytics',
                    icon='fa-line-chart',
                    category='Datascience')

appbuilder.add_view(MybnbView,
                    'MyBnB projections',
                    icon='fa-line-chart',
                    category='Datascience')


appbuilder.add_link('e.g. Churn decision tree',
                    href='/static/img/tier1_tree.png',
                    icon='fa-tree',
                    category='Datascience')

# #####################################
#          END VIEWS FOR ANALYTICS



# MYSQL VIEWS
class ToolEventView(ModelView):
    datamodel = SQLAInterface(ToolEvent)
    list_columns = ['tool_.name','event_.name','timestamp']
    search_columns = ['timestamp']
    related_views = [Tool,ToolEventName]

Ejemplo n.º 26
0
            log.error("format parameter at error=%s", e)
            return jsonify({'message': 'Wrong parameter, it should be %Y%m%d%H%M%S', 'code': 400}), 400
        try:
            data = request.get_json()
            name = data.get('name', None)
            job_id = text_type(uuid4())
            schedule_test_task.schedule(at, name, job_id=job_id)
        except Exception as e:
            log.error(e)
            return jsonify({'code': 400, 'message': str(e)}), 400

        return jsonify({'message': 'success', 'id': job_id})

appbuilder.add_view_no_menu(QueuesView)


@rq_dashboard.blueprint.before_request
@rq_scheduler_dashboard.blueprint.before_request
def check_auth():
    """dashboard permission checking interceptor."""
    if not current_user.is_authenticated:
        return render_template('401.html', base_template=appbuilder.base_template, appbuilder=appbuilder), 401
    for role in current_user.roles:
        if appbuilder.get_app.config['AUTH_ROLE_ADMIN'] == role.name:
            return None
    return render_template('403.html', base_template=appbuilder.base_template, appbuilder=appbuilder), 403
appbuilder.get_app.register_blueprint(rq_dashboard.blueprint, url_prefix="/rq")
appbuilder.add_link('tasks_queue', href="/rq", label="tasks in queue", category="Queues")
appbuilder.get_app.register_blueprint(rq_scheduler_dashboard.blueprint, url_prefix="/scheduler")
appbuilder.add_link('schedule_queue', href="/scheduler", label="schedule in queue", category="Queues")
Ejemplo n.º 27
0
    field1 = StringField(('First Name'),
        description=('Your field number one!'),
        validators = [DataRequired()], widget=BS3TextFieldWidget())
    field2 = StringField(('Last Name'),
        description=('Your field number two!'), widget=BS3TextFieldWidget())
    field3 = DateField (('Date'), format='%m/%d/%Y' ,widget =DatePickerWidget() )

class MyFormView(SimpleFormView):
    form = MyForm
    form_title = 'This is my first form view'
    message = 'My form submitted'

    def form_get(self, form):
        form.field1 = 'This was prefilled'

    def form_post(self, form):
        # post process form
        flash(self.message, 'info')

appbuilder.add_view(MyFormView, "My form View", icon="fa-group", label=_('My form View'),
                     category="My Forms", category_icon="fa-cogs")

db.create_all()



#appbuilder.add_view(MyView(), "Method2", href='/myview/method2/jonh', category='My View')
# Use add link instead there is no need to create MyView twice.
appbuilder.add_link("View Terminals", href='/Terminals/View Terminals/jonh', category='Terminals')
#appbuilder.add_link("Method3", href='/Terminals/method3/jonh', category='Terminals')
appbuilder.add_view(DepartmentView, "Create Terminals", icon="fa-folder-open-o", category="Terminals")
Ejemplo n.º 28
0
appbuilder.add_view(FoodsnackView, 'Snacks', category="Food")
appbuilder.add_view(FoodConfectioneryView, 'Confectionery', category="Food")

#Li try
appbuilder.add_view(SeaFoodView, 'SeaFood', category="FrozenFood")
appbuilder.add_view(FishView, 'Fish', category="FrozenFood")
appbuilder.add_view(MeatView, 'Meat', category="FrozenFood")

#HMK try
appbuilder.add_view(AllShopView, 'places', category='Shops')
appbuilder.add_view(ShopTypeView, 'Shop_type', category='Shops')
appbuilder.add_view(TypeOfProductView, 'Type', category='All type')
""" Page View """
appbuilder.add_view(NewsPageView, 'Local News', category="News")
appbuilder.add_link("Global News",
                    href="/newspageview/global_news/",
                    category="News")
""" Custom Views """
appbuilder.add_view(MenuItemView,
                    "MenuItem",
                    icon="fa-folder-open-o",
                    category="Admin")
appbuilder.add_view(MenuCategoryView,
                    "MenuCategory",
                    icon="fa-folder-open-o",
                    category="Admin")
appbuilder.add_view(NewsView,
                    "News",
                    icon="fa-folder-open-o",
                    category="Admin")
appbuilder.add_view(NewsCategoryView,
Ejemplo n.º 29
0
class VetMasterView(MasterDetailView):
    datamodel = SQLAModel(Vet)
    related_views = [AnimalModelView]


class StatusMasterView(MasterDetailView):
    datamodel = SQLAModel(AnimalStatus)
    related_views = [AnimalHistoryModelView]


db.create_all()
fill_data()
appbuilder.add_view(VetModelView, "Vets", icon="fa-building-o", category='Vet')
appbuilder.add_view(VetMasterView, "Vet Listing", icon="fa-paw", category='Vet')

appbuilder.add_view(PersonModelView, "People", icon="fa-users", category='Customers')
appbuilder.add_view(PaymentModelView, "Payments", icon="fa-money", category='Customers')

appbuilder.add_view(AnimalModelView, "Animal", icon="fa-paw", category='Animals')
appbuilder.add_view(AnimalHistoryModelView, "Animal History", icon="fa-paw", category='Animals')
appbuilder.add_view(AnimalStatusModelView, "Edit Status", icon="fa-paw", category='Animals')
appbuilder.add_view(ColorModelView, "Edit Colors", icon="fa-paw", category='Animals')
appbuilder.add_view(StatusMasterView, "List Status", icon="fa-paw", category='Animals')

appbuilder.add_view(BreedModelView, "Breed", icon="fa-paw", category='Breeds')
appbuilder.add_view(AnimalTypeModelView, "Animal Type", icon="fa-paw", category='Breeds')
appbuilder.add_view(BreedMasterView, "List Breeds", icon="fa-paw", category='Breeds')

appbuilder.add_link("Save-A-Pet", href="http://www.saveapetli.net/", icon="fa-paw")

Ejemplo n.º 30
0
        return json.dumps(surveylist)


class GetApi(BaseView):
    route_base = "/api/v1"

    @expose('/getdata', methods=['GET'])
    def get_data(self):
        url = "http://localhost:8080/api/v1/empdata"
        response = requests.request("GET", url)
        data = json.loads(response.text)
        ult_list = ast.literal_eval(json.dumps(data))
        header = ult_list[0].keys()
        rows = [x.values() for x in ult_list]
        return tabulate.tabulate(rows, header, tablefmt='rst')


db.create_all()
fill_gender()
appbuilder.add_view_no_menu(MyView())
appbuilder.add_view_no_menu(GetApi())
appbuilder.add_view(GroupModelView, "Departments", icon='fa-envelope')
appbuilder.add_view(ContactModelView, "About Me", icon="fa-phone")
appbuilder.add_link("List Bangalore Employee",
                    href='/api/v1/getdata',
                    icon="fa-envelope ",
                    category='Menu')
#appbuilder.add_link("Google", href="https://www.google.com/", icon = "fa-google-plus")

##############################################
Ejemplo n.º 31
0
class DataView(BaseView):
    
    route_base = "/api/v1"


    @expose('/systemdata', methods=['GET','POST'])
    def get_data(self):
        url = "http://10.60.37.41:8080/api/vi/empdataa"
        response = requests.request("GET", url)
        data=json.loads(response.text)
        ult_list = ast.literal_eval(json.dumps(data))
        header = ult_list[0].keys()
        rows =  [x.values() for x in ult_list]
        return tabulate.tabulate(rows, header, tablefmt='rst')




db.create_all()
appbuilder.add_view_no_menu(MyView())
appbuilder.add_view(MyView, "Expose", href="/api/v1/empdata", category='Task')
appbuilder.add_view(GetView, "Get Data", href="/api/v1/getdata", category='Task')
appbuilder.add_view(DataView, "Data", href="/api/v1/ipdata", category='Task')
appbuilder.add_link("Google", href="https://www.google.com/", icon = "fa-google-plus")
appbuilder.add_view(GroupModelView(), "List Groups", icon="fa-folder-open-o", category="Contacts")
appbuilder.add_view(PersonModelView(), "List Contacts", icon="fa-envelope", category="Contacts")
#appbuilder.add_view(PersonChartView(), "Contacts Chart", icon="fa-dashboard", category="Contacts")
appbuilder.add_view(ContactTimeChartView, "Contacts Birth Chart", icon="fa-dashboard", category="Contacts")

Ejemplo n.º 32
0
class TravelPlanView(ModelView):
    datamodel = SQLAInterface(TravelPlan)
    list_columns = ['id', 'name', 'price']


class SpecialPlanView(ModelView):
    datamodel = SQLAInterface(SpecialPlan)
    list_columns = ['id', 'name', 'price', 'date']


db.create_all()
""" Page View """
appbuilder.add_view(ServiceView, 'fibrebroadband', category="Service")
appbuilder.add_link("Smart Home",
                    href="/serviceview/smarthome/",
                    category="Service")
appbuilder.add_link("Voice Calls",
                    href="/serviceview/voicecalls/",
                    category="Service")
appbuilder.add_link("Mobile Voice",
                    href="/serviceview/mobileservices/",
                    category="Service")
appbuilder.add_link("Cyber Security",
                    href="/serviceview/cybersecurity/",
                    category="Service")
appbuilder.add_link("Entertainment",
                    href="/serviceview/entertainment/",
                    category="Service")
appbuilder.add_link("Travel", href="/serviceview/travel/", category="Service")
appbuilder.add_link("Smartphones and Smart Products",
Ejemplo n.º 33
0
        return self.render_template('Special.html')


class ControlView(ModelView):
    datamodel = SQLAInterface(Control)
    list_columns = ['id', 'user_id', 'name', 'total']


class LoginView(ModelView):
    datamodel = SQLAInterface(User)
    list_columns = ['id', 'first_name', 'last_name', 'last_login']


appbuilder.add_link("Instructions",
                    label=_('Instructions'),
                    href='/GameScores/Instructions',
                    icon="fa-question",
                    category='Rules')
appbuilder.add_link("Special",
                    label=_('Special'),
                    href='/GameScores/Special',
                    category='Rules')

appbuilder.add_view(GroupsTeams,
                    "Groups",
                    href='/groupsteams/list/1',
                    label=_('Groups'),
                    icon="fa-users",
                    category="Groups",
                    category_icon="fa-flag")
Ejemplo n.º 34
0
    def promotion(self):
        param1 = 'Promotion'
        self.update_redirect()
        return self.render_template('news.html', param1 = param1)
        
    @expose('/testing/')
    def testing(self):
        param1 = 'Testing'
        self.update_redirect()
        return self.render_template('news.html', param1 = param1)
    
db.create_all()

""" Page View """
appbuilder.add_view(NewsPageView, 'Local News', category="News")
appbuilder.add_link("Global News", href="/newspageview/global_news/", category="News")
appbuilder.add_link("Entertainment News", href="/newspageview/entertainment_news/", category="News")

appbuilder.add_view(Video, "Video", category="Video")
appbuilder.add_link("Testing", href="/video/testing/", category="Video")

appbuilder.add_view(Promotion, "Promotion", category="Promotion")
appbuilder.add_link("Testing", href="/promotion/testing/", category="Promotion")

""" Custom Views """
appbuilder.add_view(MenuItemView, "MenuItem", icon="fa-folder-open-o", category="Admin")
appbuilder.add_view(MenuCategoryView, "MenuCategory", icon="fa-folder-open-o", category="Admin")
appbuilder.add_view(NewsView, "News", icon="fa-folder-open-o", category="Admin")
appbuilder.add_view(NewsCategoryView, "NewsCategory", icon="fa-folder-open-o", category="Admin")

Ejemplo n.º 35
0
    def phase12h(self):
        return redirect(get_url(720, 'teleinfohourphaseschartview'))

    @expose('/24h/')
    def phase24h(self):
        return redirect(get_url(1440, 'teleinfohourphaseschartview'))

    @expose('/1sem/')
    def phase1sem(self):
        return redirect(get_url(10080, 'teleinfohourphaseschartview'))


""" Menu Chart Phase """
appbuilder.add_view_no_menu(MenuPhase)
appbuilder.add_link("15 minutes",
                    href='/menuphase/15min',
                    icon="fa-bar-chart",
                    category='Phase')

appbuilder.add_link("1 heure",
                    href='/menuphase/1h',
                    icon="fa-bar-chart",
                    category='Phase')

appbuilder.add_link("12 heures",
                    href='/menuphase/12h',
                    icon="fa-bar-chart",
                    category='Phase')

appbuilder.add_link("24 heures",
                    href='/menuphase/24h',
                    icon="fa-bar-chart",
Ejemplo n.º 36
0
        })
        if resp.status == 403:
            flash('Your tweet was too long. {0}'.format(resp.raw_data))
        else:
            flash('Successfully tweeted your tweet (ID: #%s)' % resp.data['id'])
        return redirect(self.appbuilder.get_url_for_index)

        
fill_gender()

appbuilder.add_view(GroupModelView, "List Groups", icon="fa-folder-open-o", category="Contacts",
                    category_icon='fa-envelope')
appbuilder.add_view(ContactModelView, "List Contacts", icon="fa-envelope", category="Contacts")
appbuilder.add_view(ContactModelView2, "List Contacts 2", icon="fa-envelope", category="Contacts")
appbuilder.add_view(FloatModelView, "List Float Model", icon="fa-envelope", category="Contacts")
appbuilder.add_view(MultipleViewsExp, "Multiple Views", icon="fa-envelope", category="Contacts")
appbuilder.add_separator("Contacts")
appbuilder.add_view(ContactChartView, "Contacts Chart", icon="fa-dashboard", category="Contacts")
appbuilder.add_view(ContactTimeChartView, "Contacts Birth Chart", icon="fa-dashboard", category="Contacts")

appbuilder.add_view(ProductManufacturerView, "List Manufacturer", icon="fa-folder-open-o", category="Products",
                    category_icon='fa-envelope')
appbuilder.add_view(ProductModelView, "List Models", icon="fa-envelope", category="Products")
appbuilder.add_view(ProductView, "List Products", icon="fa-envelope", category="Products")
appbuilder.add_link("ContacModelView_lnk","ContactModelView.add", icon="fa-envelope", label="Add Contact")
appbuilder.add_view(TestForm, "My form View", icon="fa-group", label='My Test form')
appbuilder.add_view(PostTweet, "Tweet", icon="fa-twitter", label='Tweet')

appbuilder.add_link("Index","MyIndexView.index")
appbuilder.security_cleanup()
Ejemplo n.º 37
0
class PaymentPageView(BaseView):
    default_view = 'payment'

    @expose('/payment/')
    def payment(self):
        param1 = 'Payment'
        self.update_redirect()
        return self.render_template('payment.html', param1=param1)


db.create_all()
""" Page View """
appbuilder.add_view(ProductPageView, 'Hit Product', category="Product")
appbuilder.add_link("Phone",
                    href="/productpageview/phone/",
                    category="Product")
appbuilder.add_view(PaymentPageView, 'payment', category="payment")

# Add a link
appbuilder.add_link("Facebook",
                    href="https://www.facebook.com/BroadwayHK/",
                    icon="fa-facebook")
appbuilder.add_link("Promotions",
                    href="https://www.broadwaylifestyle.com/promotions/")

appbuilder.add_view_no_menu(EmployeeHistoryView, "EmployeeHistoryView")
appbuilder.add_view(EmployeeView,
                    "Employees",
                    icon="fa-folder-open-o",
                    category="Company")