Let tailbone providers include static views

also add more native (batch) views to default list
This commit is contained in:
Lance Edgar 2022-03-06 22:06:57 -06:00
parent d18bade951
commit 7c4e9b56c7
3 changed files with 37 additions and 1 deletions

View file

@ -154,11 +154,19 @@ def make_pyramid_config(settings, configure_csrf=True):
else: else:
config.include('pyramid_retry') config.include('pyramid_retry')
# configure DB sessions associated with transaction manager # fetch all tailbone providers
providers = get_all_providers(rattail_config) providers = get_all_providers(rattail_config)
for provider in six.itervalues(providers): for provider in six.itervalues(providers):
# configure DB sessions associated with transaction manager
provider.configure_db_sessions(rattail_config, config) provider.configure_db_sessions(rattail_config, config)
# add any static includes
includes = provider.get_static_includes()
if includes:
for spec in includes:
config.include(spec)
# Add some permissions magic. # Add some permissions magic.
config.add_directive('add_tailbone_permission_group', 'tailbone.auth.add_permission_group') config.add_directive('add_tailbone_permission_group', 'tailbone.auth.add_permission_group')
config.add_directive('add_tailbone_permission', 'tailbone.auth.add_permission') config.add_directive('add_tailbone_permission', 'tailbone.auth.add_permission')

View file

@ -42,6 +42,9 @@ class TailboneProvider(object):
def configure_db_sessions(self, rattail_config, pyramid_config): def configure_db_sessions(self, rattail_config, pyramid_config):
pass pass
def get_static_includes(self):
pass
def get_provided_views(self): def get_provided_views(self):
return {} return {}

View file

@ -170,6 +170,31 @@ class PoserViewView(PoserMasterView):
}, },
}, },
'batches': {
'tailbone.views.batch.delproduct': {
'label': "Delete Product",
},
'tailbone.views.batch.inventory': {
'label': "Inventory",
},
'tailbone.views.batch.labels': {
'label': "Labels",
},
'tailbone.views.batch.newproduct': {
'label': "New Product",
},
'tailbone.views.batch.pricing': {
'label': "Pricing",
},
'tailbone.views.batch.product': {
'label': "Product",
},
'tailbone.views.batch.vendorcatalog': {
'label': "Vendor Catalog",
},
},
'other': { 'other': {
'tailbone.views.stores': { 'tailbone.views.stores': {