Remove some deprecated field renderers

This commit is contained in:
Lance Edgar 2016-12-10 10:14:52 -06:00
parent 8ed4421b03
commit 6389481cea
3 changed files with 7 additions and 19 deletions

View file

@ -35,19 +35,13 @@ from .common import (StrippedTextFieldRenderer, CodeTextAreaFieldRenderer, Autoc
from .files import FileFieldRenderer from .files import FileFieldRenderer
# TODO: deprecate / remove Link renderers from .people import PersonFieldRenderer, CustomerFieldRenderer
from .people import (PersonFieldRenderer, PersonFieldLinkRenderer,
CustomerFieldRenderer, CustomerFieldLinkRenderer)
from .users import UserFieldRenderer, PermissionsFieldRenderer from .users import UserFieldRenderer, PermissionsFieldRenderer
from .employees import EmployeeFieldRenderer from .employees import EmployeeFieldRenderer
from .stores import StoreFieldRenderer
from .vendors import VendorFieldRenderer, PurchaseFieldRenderer
from .products import (GPCFieldRenderer, DepartmentFieldRenderer, BrandFieldRenderer, from .products import (GPCFieldRenderer, DepartmentFieldRenderer, BrandFieldRenderer,
ProductFieldRenderer, PriceFieldRenderer, PriceWithExpirationFieldRenderer) ProductFieldRenderer, PriceFieldRenderer, PriceWithExpirationFieldRenderer)
from .stores import StoreFieldRenderer
from .vendors import VendorFieldRenderer, PurchaseFieldRenderer
from .batch import BatchIDFieldRenderer, HandheldBatchFieldRenderer from .batch import BatchIDFieldRenderer, HandheldBatchFieldRenderer

View file

@ -35,7 +35,6 @@ class PersonFieldRenderer(AutocompleteFieldRenderer):
""" """
Renderer for :class:`rattail.db.model.Person` instance fields. Renderer for :class:`rattail.db.model.Person` instance fields.
""" """
service_route = 'people.autocomplete' service_route = 'people.autocomplete'
def render_readonly(self, **kwargs): def render_readonly(self, **kwargs):
@ -44,9 +43,6 @@ class PersonFieldRenderer(AutocompleteFieldRenderer):
return '' return ''
return tags.link_to(person, self.request.route_url('people.view', uuid=person.uuid)) return tags.link_to(person, self.request.route_url('people.view', uuid=person.uuid))
# TODO: deprecate / remove this
PersonFieldLinkRenderer = PersonFieldRenderer
class CustomerFieldRenderer(AutocompleteFieldRenderer): class CustomerFieldRenderer(AutocompleteFieldRenderer):
""" """
@ -60,6 +56,3 @@ class CustomerFieldRenderer(AutocompleteFieldRenderer):
if not customer: if not customer:
return '' return ''
return tags.link_to(customer, self.request.route_url('customers.view', uuid=customer.uuid)) return tags.link_to(customer, self.request.route_url('customers.view', uuid=customer.uuid))
# TODO: deprecate / remove this
CustomerFieldLinkRenderer = CustomerFieldRenderer

View file

@ -156,15 +156,16 @@ class UsersView(MasterView):
], ],
readonly=True) readonly=True)
def configure_fieldset(self, fs): def _preconfigure_fieldset(self, fs):
fs.username.set(renderer=forms.renderers.StrippedTextFieldRenderer, validate=unique_username) fs.username.set(renderer=forms.renderers.StrippedTextFieldRenderer, validate=unique_username)
fs.person.set(options=[]) fs.person.set(renderer=forms.renderers.PersonFieldRenderer, options=[])
fs.person.set(renderer=forms.renderers.PersonFieldLinkRenderer)
fs.append(PasswordField('password', label="Set Password")) fs.append(PasswordField('password', label="Set Password"))
fs.password.attrs(autocomplete='off') fs.password.attrs(autocomplete='off')
fs.append(formalchemy.Field('confirm_password', renderer=PasswordFieldRenderer)) fs.append(formalchemy.Field('confirm_password', renderer=PasswordFieldRenderer))
fs.confirm_password.attrs(autocomplete='off') fs.confirm_password.attrs(autocomplete='off')
fs.append(RolesField('roles', renderer=RolesFieldRenderer(self.request))) fs.append(RolesField('roles', renderer=RolesFieldRenderer(self.request)))
def configure_fieldset(self, fs):
fs.configure( fs.configure(
include=[ include=[
fs.username, fs.username,