Ejemplo n.º 1
0
from app.blueprints import MyBlueprint
from flask import send_from_directory
import os

view_funcs_list = (
    dict(import_name='view_funcs.root_view_handler',
         url_rules=['/'],
         endpoint='index'),
    dict(import_name='favicon_handler', url_rules=['/favicon.ico']),
)
bp = MyBlueprint(__name__, url_rules=view_funcs_list, has_url_prefix=False)


def favicon_handler():
    return send_from_directory(os.path.join(bp.root_path, bp.static_folder),
                               'favicon.ico',
                               mimetype='image/vnd.microsoft.icon')
Ejemplo n.º 2
0
from app.blueprints import MyBlueprint

bp = MyBlueprint(__name__)

# Add Url Rules (rule - endpoint - view function)
view_funcs_list = (
    dict(import_name='data_user.get_current_user',
         url_rules=['/'],
         endpoint='index'),

    # MailBox
    dict(import_name='data_excel_mail.today',
         url_rules=['/mailbox/today', '/mailbox/today/<int:year_offset>']),
    dict(import_name='data_excel_mail.date',
         url_rules=['/mailbox/ymd', '/mailbox/ymd/<string:str_date>']),
    dict(import_name='data_excel_mail.year_month',
         url_rules=['/mailbox/ym/<string:str_yearmonth>']),

    # THANKQ
    dict(import_name='data_thankq.payments', url_rules=['/tq/payments']),
    dict(import_name='data_thankq.fys_summary', url_rules=['/tq/fys_summary']),
    dict(import_name='data_thankq.source_code1_summary',
         url_rules=['/tq/source_code1_summary']),
    dict(import_name='data_thankq.contact_created_fy',
         url_rules=['/tq/contact_created_fy']),
    dict(import_name='data_thankq.new_customer_list',
         url_rules=['/merch/new_customers']),
    dict(import_name='data_thankq.journey_cureone_acquisiton_donors',
         url_rules=['/campaign/journey_cureone_acquisition']),
    dict(import_name='data_thankq.christmas_appeal_donors',
         url_rules=['/campaign/christmas_appeal']),
Ejemplo n.º 3
0
from app.blueprints import MyBlueprint
from app.helper import apply_template

view_funcs_list = (dict(import_name='index', url_rules=['/'],
                        endpoint='index'), )
bp = MyBlueprint(__name__, url_rules=view_funcs_list)


@apply_template('example', 'Dash')
def index():
    return dict(endpoints=('.'.join((bp.name, item['endpoint'] if item.get(
        'endpoint', False) else item['import_name']))
                           for item in view_funcs_list))