Update some more view config syntax
some common ones used by a particular app..
This commit is contained in:
parent
738d5d94e0
commit
a28a801a62
|
@ -329,5 +329,12 @@ class EmployeeView(MasterView):
|
|||
"View *all* (not just current) {}".format(model_title_plural))
|
||||
|
||||
|
||||
def includeme(config):
|
||||
def defaults(config, **kwargs):
|
||||
base = globals()
|
||||
|
||||
EmployeeView = kwargs.get('EmployeeView', base['EmployeeView'])
|
||||
EmployeeView.defaults(config)
|
||||
|
||||
|
||||
def includeme(config):
|
||||
defaults(config)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
################################################################################
|
||||
#
|
||||
# Rattail -- Retail Software Framework
|
||||
# Copyright © 2010-2021 Lance Edgar
|
||||
# Copyright © 2010-2022 Lance Edgar
|
||||
#
|
||||
# This file is part of Rattail.
|
||||
#
|
||||
|
@ -1470,7 +1470,18 @@ class MergePeopleRequestView(MasterView):
|
|||
return "(person not found)"
|
||||
|
||||
|
||||
def includeme(config):
|
||||
def defaults(config, **kwargs):
|
||||
base = globals()
|
||||
|
||||
PersonView = kwargs.get('PersonView', base['PersonView'])
|
||||
PersonView.defaults(config)
|
||||
|
||||
PersonNoteView = kwargs.get('PersonNoteView', base['PersonNoteView'])
|
||||
PersonNoteView.defaults(config)
|
||||
|
||||
MergePeopleRequestView = kwargs.get('MergePeopleRequestView', base['MergePeopleRequestView'])
|
||||
MergePeopleRequestView.defaults(config)
|
||||
|
||||
|
||||
def includeme(config):
|
||||
defaults(config)
|
||||
|
|
|
@ -2405,6 +2405,15 @@ class PendingProductView(MasterView):
|
|||
permission='{}.resolve_product'.format(permission_prefix))
|
||||
|
||||
|
||||
def includeme(config):
|
||||
def defaults(config, **kwargs):
|
||||
base = globals()
|
||||
|
||||
ProductView = kwargs.get('ProductView', base['ProductView'])
|
||||
ProductView.defaults(config)
|
||||
|
||||
PendingProductView = kwargs.get('PendingProductView', base['PendingProductView'])
|
||||
PendingProductView.defaults(config)
|
||||
|
||||
|
||||
def includeme(config):
|
||||
defaults(config)
|
||||
|
|
7
tailbone/views/vendors/__init__.py
vendored
7
tailbone/views/vendors/__init__.py
vendored
|
@ -2,7 +2,7 @@
|
|||
################################################################################
|
||||
#
|
||||
# Rattail -- Retail Software Framework
|
||||
# Copyright © 2010-2021 Lance Edgar
|
||||
# Copyright © 2010-2022 Lance Edgar
|
||||
#
|
||||
# This file is part of Rattail.
|
||||
#
|
||||
|
@ -29,5 +29,10 @@ from __future__ import unicode_literals, absolute_import
|
|||
from .core import VendorView
|
||||
|
||||
|
||||
def defaults(config, **kwargs):
|
||||
from .core import defaults
|
||||
return defaults(config, **kwargs)
|
||||
|
||||
|
||||
def includeme(config):
|
||||
config.include('tailbone.views.vendors.core')
|
||||
|
|
9
tailbone/views/vendors/core.py
vendored
9
tailbone/views/vendors/core.py
vendored
|
@ -180,5 +180,12 @@ class VendorView(MasterView):
|
|||
]
|
||||
|
||||
|
||||
def includeme(config):
|
||||
def defaults(config, **kwargs):
|
||||
base = globals()
|
||||
|
||||
VendorView = kwargs.get('VendorView', base['VendorView'])
|
||||
VendorView.defaults(config)
|
||||
|
||||
|
||||
def includeme(config):
|
||||
defaults(config)
|
||||
|
|
Loading…
Reference in a new issue