Update some more view config syntax

some common ones used by a particular app..
This commit is contained in:
Lance Edgar 2022-03-04 12:32:16 -06:00
parent 738d5d94e0
commit a28a801a62
5 changed files with 45 additions and 6 deletions

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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')

View file

@ -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)