Normalize naming of all traditional master views
such names should never use plural forms. for now what plural forms were previously in use, should still work. ideally can remove those at some point
This commit is contained in:
parent
3ad19d05e5
commit
719e7c8441
30 changed files with 273 additions and 177 deletions
|
@ -2,7 +2,7 @@
|
|||
################################################################################
|
||||
#
|
||||
# Rattail -- Retail Software Framework
|
||||
# Copyright © 2010-2019 Lance Edgar
|
||||
# Copyright © 2010-2021 Lance Edgar
|
||||
#
|
||||
# This file is part of Rattail.
|
||||
#
|
||||
|
@ -40,7 +40,7 @@ from tailbone.db import Session
|
|||
from tailbone.views import MasterView, AutocompleteView
|
||||
|
||||
|
||||
class EmployeesView(MasterView):
|
||||
class EmployeeView(MasterView):
|
||||
"""
|
||||
Master view for the Employee class.
|
||||
"""
|
||||
|
@ -80,7 +80,7 @@ class EmployeesView(MasterView):
|
|||
]
|
||||
|
||||
def configure_grid(self, g):
|
||||
super(EmployeesView, self).configure_grid(g)
|
||||
super(EmployeeView, self).configure_grid(g)
|
||||
route_prefix = self.get_route_prefix()
|
||||
|
||||
# phone
|
||||
|
@ -181,7 +181,7 @@ class EmployeesView(MasterView):
|
|||
return not self.is_employee_protected(employee)
|
||||
|
||||
def configure_form(self, f):
|
||||
super(EmployeesView, self).configure_form(f)
|
||||
super(EmployeeView, self).configure_form(f)
|
||||
employee = f.model_instance
|
||||
|
||||
f.set_renderer('person', self.render_person)
|
||||
|
@ -230,7 +230,7 @@ class EmployeesView(MasterView):
|
|||
def objectify(self, form, data=None):
|
||||
if data is None:
|
||||
data = form.validated
|
||||
employee = super(EmployeesView, self).objectify(form, data)
|
||||
employee = super(EmployeeView, self).objectify(form, data)
|
||||
self.update_stores(employee, data)
|
||||
self.update_departments(employee, data)
|
||||
return employee
|
||||
|
@ -304,6 +304,9 @@ class EmployeesView(MasterView):
|
|||
(model.EmployeeDepartment, 'employee_uuid'),
|
||||
]
|
||||
|
||||
# TODO: deprecate / remove this
|
||||
EmployeesView = EmployeeView
|
||||
|
||||
|
||||
class EmployeesAutocomplete(AutocompleteView):
|
||||
"""
|
||||
|
@ -328,4 +331,4 @@ def includeme(config):
|
|||
config.add_view(EmployeesAutocomplete, route_name='employees.autocomplete',
|
||||
renderer='json', permission='employees.list')
|
||||
|
||||
EmployeesView.defaults(config)
|
||||
EmployeeView.defaults(config)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue