Add basic mobile support for executing batches

no progress, or options, yet..
This commit is contained in:
Lance Edgar 2018-02-21 18:55:16 -06:00
parent 6ca69802f5
commit a8a4e362a0
3 changed files with 58 additions and 12 deletions

View file

@ -88,6 +88,7 @@ class MasterView(View):
mobile_creatable = False
mobile_pageable = True
mobile_filterable = False
mobile_executable = False
listing = False
creating = False
@ -2746,12 +2747,17 @@ class MasterView(View):
"Edit {0}".format(model_title))
# execute
if cls.executable:
if cls.executable or cls.mobile_executable:
config.add_tailbone_permission(permission_prefix, '{}.execute'.format(permission_prefix),
"Execute {}".format(model_title))
if cls.executable:
config.add_route('{}.execute'.format(route_prefix), '{}/{{{}}}/execute'.format(url_prefix, model_key))
config.add_view(cls, attr='execute', route_name='{}.execute'.format(route_prefix),
permission='{}.execute'.format(permission_prefix))
if cls.mobile_executable:
config.add_route('mobile.{}.execute'.format(route_prefix), '/mobile{}/{{{}}}/execute'.format(url_prefix, model_key))
config.add_view(cls, attr='mobile_execute', route_name='mobile.{}.execute'.format(route_prefix),
permission='{}.execute'.format(permission_prefix))
# delete
if cls.deletable: