Morph project => rattail-demo
This commit is contained in:
parent
a38c832dee
commit
220c6184aa
14 changed files with 219 additions and 162 deletions
51
rattail_demo/web/views/__init__.py
Normal file
51
rattail_demo/web/views/__init__.py
Normal file
|
@ -0,0 +1,51 @@
|
|||
# -*- 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):
|
||||
|
||||
config.add_route('home', '/')
|
||||
config.add_view(base.home, route_name='home', renderer='/home.mako')
|
||||
|
||||
config.add_route('bogus_error', '/bogus-error')
|
||||
config.add_view(bogus_error, route_name='bogus_error',
|
||||
permission='admin')
|
||||
|
||||
# TODO: merge above views into common
|
||||
# core views
|
||||
config.include('rattail_demo.web.views.common')
|
||||
config.include('tailbone.views.auth')
|
||||
|
||||
# main table views
|
||||
config.include('tailbone.views.brands')
|
||||
config.include('tailbone.views.customers')
|
||||
config.include('tailbone.views.departments')
|
||||
config.include('tailbone.views.employees')
|
||||
config.include('tailbone.views.families')
|
||||
config.include('tailbone.views.people')
|
||||
config.include('tailbone.views.products')
|
||||
config.include('tailbone.views.reportcodes')
|
||||
config.include('tailbone.views.roles')
|
||||
config.include('tailbone.views.settings')
|
||||
config.include('tailbone.views.stores')
|
||||
config.include('tailbone.views.subdepartments')
|
||||
config.include('tailbone.views.users')
|
||||
config.include('tailbone.views.vendors')
|
||||
|
||||
# batch views
|
||||
config.include('tailbone.views.handheld')
|
||||
config.include('tailbone.views.inventory')
|
20
rattail_demo/web/views/common.py
Normal file
20
rattail_demo/web/views/common.py
Normal file
|
@ -0,0 +1,20 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Common views
|
||||
"""
|
||||
|
||||
from __future__ import unicode_literals, absolute_import
|
||||
|
||||
from tailbone.views import common as base
|
||||
|
||||
import rattail_demo
|
||||
|
||||
|
||||
class CommonView(base.CommonView):
|
||||
|
||||
project_title = "Rattail Demo"
|
||||
project_version = rattail_demo.__version__
|
||||
|
||||
|
||||
def includeme(config):
|
||||
CommonView.defaults(config)
|
Loading…
Add table
Add a link
Reference in a new issue