rattail-demo/rattail_demo/web/views/__init__.py

56 lines
1.9 KiB
Python
Raw Normal View History

2016-12-07 20:24:11 -06:00
# -*- coding: utf-8 -*-
"""
Web views
"""
from __future__ import unicode_literals, absolute_import
from tailbone import views as base
def bogus_error(request):
"""
A special view which simply raises an error, for the sake of testing
uncaught exception handling.
"""
raise Exception("Congratulations, you have triggered a bogus error.")
def includeme(config):
# TODO: merge these views into core/common
2016-12-07 20:24:11 -06:00
config.add_route('home', '/')
config.add_view(base.home, route_name='home', renderer='/home.mako')
config.add_route('mobile.home', '/mobile/')
config.add_view(base.home, route_name='mobile.home', renderer='/mobile/home.mako')
2016-12-07 20:24:11 -06:00
config.add_route('bogus_error', '/bogus-error')
config.add_view(bogus_error, route_name='bogus_error', permission='admin')
2016-12-07 20:24:11 -06:00
# core views
config.include('rattail_demo.web.views.common')
config.include('rattail_demo.web.views.auth')
2016-12-07 20:24:11 -06:00
# main table views
config.include('tailbone.views.brands')
config.include('tailbone.views.customers')
config.include('tailbone.views.departments')
config.include('rattail_demo.web.views.email')
config.include('rattail_demo.web.views.employees')
2016-12-07 20:24:11 -06:00
config.include('tailbone.views.families')
2016-12-10 15:40:21 -06:00
config.include('tailbone.views.messages')
config.include('rattail_demo.web.views.people')
2016-12-07 20:24:11 -06:00
config.include('tailbone.views.products')
config.include('tailbone.views.reportcodes')
config.include('tailbone.views.roles')
config.include('rattail_demo.web.views.settings')
config.include('tailbone.views.shifts')
2016-12-07 20:24:11 -06:00
config.include('tailbone.views.stores')
config.include('tailbone.views.subdepartments')
2016-12-10 11:24:01 -06:00
config.include('rattail_demo.web.views.tempmon')
config.include('rattail_demo.web.views.users')
2016-12-07 20:24:11 -06:00
config.include('tailbone.views.vendors')
# batch views
config.include('tailbone.views.handheld')
config.include('tailbone.views.inventory')