Remove some deprecated field renderers
This commit is contained in:
parent
8ed4421b03
commit
6389481cea
|
@ -35,19 +35,13 @@ from .common import (StrippedTextFieldRenderer, CodeTextAreaFieldRenderer, Autoc
|
|||
|
||||
from .files import FileFieldRenderer
|
||||
|
||||
# TODO: deprecate / remove Link renderers
|
||||
from .people import (PersonFieldRenderer, PersonFieldLinkRenderer,
|
||||
CustomerFieldRenderer, CustomerFieldLinkRenderer)
|
||||
|
||||
from .people import PersonFieldRenderer, CustomerFieldRenderer
|
||||
from .users import UserFieldRenderer, PermissionsFieldRenderer
|
||||
|
||||
from .employees import EmployeeFieldRenderer
|
||||
|
||||
from .stores import StoreFieldRenderer
|
||||
from .vendors import VendorFieldRenderer, PurchaseFieldRenderer
|
||||
from .products import (GPCFieldRenderer, DepartmentFieldRenderer, BrandFieldRenderer,
|
||||
ProductFieldRenderer, PriceFieldRenderer, PriceWithExpirationFieldRenderer)
|
||||
|
||||
from .stores import StoreFieldRenderer
|
||||
|
||||
from .vendors import VendorFieldRenderer, PurchaseFieldRenderer
|
||||
|
||||
from .batch import BatchIDFieldRenderer, HandheldBatchFieldRenderer
|
||||
|
|
|
@ -35,7 +35,6 @@ class PersonFieldRenderer(AutocompleteFieldRenderer):
|
|||
"""
|
||||
Renderer for :class:`rattail.db.model.Person` instance fields.
|
||||
"""
|
||||
|
||||
service_route = 'people.autocomplete'
|
||||
|
||||
def render_readonly(self, **kwargs):
|
||||
|
@ -44,9 +43,6 @@ class PersonFieldRenderer(AutocompleteFieldRenderer):
|
|||
return ''
|
||||
return tags.link_to(person, self.request.route_url('people.view', uuid=person.uuid))
|
||||
|
||||
# TODO: deprecate / remove this
|
||||
PersonFieldLinkRenderer = PersonFieldRenderer
|
||||
|
||||
|
||||
class CustomerFieldRenderer(AutocompleteFieldRenderer):
|
||||
"""
|
||||
|
@ -60,6 +56,3 @@ class CustomerFieldRenderer(AutocompleteFieldRenderer):
|
|||
if not customer:
|
||||
return ''
|
||||
return tags.link_to(customer, self.request.route_url('customers.view', uuid=customer.uuid))
|
||||
|
||||
# TODO: deprecate / remove this
|
||||
CustomerFieldLinkRenderer = CustomerFieldRenderer
|
||||
|
|
|
@ -156,15 +156,16 @@ class UsersView(MasterView):
|
|||
],
|
||||
readonly=True)
|
||||
|
||||
def configure_fieldset(self, fs):
|
||||
def _preconfigure_fieldset(self, fs):
|
||||
fs.username.set(renderer=forms.renderers.StrippedTextFieldRenderer, validate=unique_username)
|
||||
fs.person.set(options=[])
|
||||
fs.person.set(renderer=forms.renderers.PersonFieldLinkRenderer)
|
||||
fs.person.set(renderer=forms.renderers.PersonFieldRenderer, options=[])
|
||||
fs.append(PasswordField('password', label="Set Password"))
|
||||
fs.password.attrs(autocomplete='off')
|
||||
fs.append(formalchemy.Field('confirm_password', renderer=PasswordFieldRenderer))
|
||||
fs.confirm_password.attrs(autocomplete='off')
|
||||
fs.append(RolesField('roles', renderer=RolesFieldRenderer(self.request)))
|
||||
|
||||
def configure_fieldset(self, fs):
|
||||
fs.configure(
|
||||
include=[
|
||||
fs.username,
|
||||
|
|
Loading…
Reference in a new issue