Add more basic config views, obviating some App Settings
This commit is contained in:
parent
16bc3076ad
commit
1244659064
8 changed files with 107 additions and 1 deletions
|
@ -287,6 +287,12 @@ class MasterView(View):
|
|||
return self.request.has_perm('{}.{}'.format(
|
||||
self.get_permission_prefix(), name))
|
||||
|
||||
@classmethod
|
||||
def get_config_url(cls):
|
||||
if hasattr(cls, 'config_url'):
|
||||
return cls.config_url
|
||||
return '{}/configure'.format(cls.get_url_prefix())
|
||||
|
||||
##############################
|
||||
# Available Views
|
||||
##############################
|
||||
|
@ -4265,7 +4271,7 @@ class MasterView(View):
|
|||
'{}.configure'.format(permission_prefix),
|
||||
label="Configure {}".format(config_title))
|
||||
config.add_route('{}.configure'.format(route_prefix),
|
||||
'{}/configure'.format(url_prefix))
|
||||
cls.get_config_url())
|
||||
config.add_view(cls, attr='configure',
|
||||
route_name='{}.configure'.format(route_prefix),
|
||||
permission='{}.configure'.format(permission_prefix))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue