Add basic master view for Report Output data model

This commit is contained in:
Lance Edgar 2017-03-22 14:27:59 -05:00
parent e34bd947bc
commit 6adb99003d
3 changed files with 60 additions and 11 deletions

View file

@ -56,6 +56,7 @@ class MasterView(View):
deletable = True
bulk_deletable = False
mergeable = False
downloadable = False
supports_mobile = False
@ -1456,6 +1457,14 @@ class MasterView(View):
config.add_view(cls, attr='mobile_view', route_name='mobile.{}.view'.format(route_prefix),
permission='{}.view'.format(permission_prefix))
# download
if cls.downloadable:
config.add_route('{}.download'.format(route_prefix), '{}/{{{}}}/download'.format(url_prefix, model_key))
config.add_view(cls, attr='download', route_name='{}.download'.format(route_prefix),
permission='{}.download'.format(permission_prefix))
config.add_tailbone_permission(permission_prefix, '{}.download'.format(permission_prefix),
"Download associated data for {}".format(model_title))
# edit
if cls.editable:
config.add_route('{0}.edit'.format(route_prefix), '{0}/{{{1}}}/edit'.format(url_prefix, model_key))