Use new-style config defaults for customer views
This commit is contained in:
parent
85ef73dcb9
commit
a6d97538af
|
@ -614,12 +614,23 @@ def customer_info(request):
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def includeme(config):
|
def defaults(config, **kwargs):
|
||||||
|
base = globals()
|
||||||
|
|
||||||
# info
|
# TODO: deprecate / remove this
|
||||||
config.add_route('customer.info', '/customers/info')
|
config.add_route('customer.info', '/customers/info')
|
||||||
|
customer_info = kwargs.get('customer_info', base['customer_info'])
|
||||||
config.add_view(customer_info, route_name='customer.info',
|
config.add_view(customer_info, route_name='customer.info',
|
||||||
renderer='json', permission='customers.view')
|
renderer='json', permission='customers.view')
|
||||||
|
|
||||||
|
CustomerView = kwargs.get('CustomerView',
|
||||||
|
base['CustomerView'])
|
||||||
CustomerView.defaults(config)
|
CustomerView.defaults(config)
|
||||||
|
|
||||||
|
PendingCustomerView = kwargs.get('PendingCustomerView',
|
||||||
|
base['PendingCustomerView'])
|
||||||
PendingCustomerView.defaults(config)
|
PendingCustomerView.defaults(config)
|
||||||
|
|
||||||
|
|
||||||
|
def includeme(config):
|
||||||
|
defaults(config)
|
||||||
|
|
Loading…
Reference in a new issue