use new Jeep convenience methods for position of fields on schemas
git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@2110 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
parent
907dda565a
commit
a5847a6fb2
2 changed files with 16 additions and 18 deletions
|
@ -64,17 +64,17 @@ class MyStuff(ConceptView):
|
|||
return self
|
||||
|
||||
|
||||
class PasswordWidget(BasePasswordWidget):
|
||||
|
||||
def getInputValue(self):
|
||||
value = super(PasswordWidget, self).getInputValue()
|
||||
confirm = self.request.get('form.passwordConfirm')
|
||||
if confirm != value:
|
||||
v = _(u'Password and password confirmation do not match.')
|
||||
self._error = WidgetInputError(
|
||||
self.context.__name__, self.label, v)
|
||||
raise self._error
|
||||
return value
|
||||
#class PasswordWidget(BasePasswordWidget):
|
||||
#
|
||||
# def getInputValue(self):
|
||||
# value = super(PasswordWidget, self).getInputValue()
|
||||
# confirm = self.request.get('form.passwordConfirm')
|
||||
# if confirm != value:
|
||||
# v = _(u'Password and password confirmation do not match.')
|
||||
# self._error = WidgetInputError(
|
||||
# self.context.__name__, self.label, v)
|
||||
# raise self._error
|
||||
# return value
|
||||
|
||||
|
||||
class MemberRegistration(NodeView, CreateForm):
|
||||
|
@ -100,8 +100,8 @@ class MemberRegistration(NodeView, CreateForm):
|
|||
@Lazy
|
||||
def schema(self):
|
||||
schema = super(MemberRegistration, self).schema
|
||||
if 'birthDate' in schema.fields:
|
||||
del schema.fields['birthDate']
|
||||
schema.fields.remove('birthDate')
|
||||
schema.fields.reorder(-2, 'loginName')
|
||||
return schema
|
||||
|
||||
@Lazy
|
||||
|
|
|
@ -44,9 +44,8 @@ class FileSchemaFactory(SchemaFactory):
|
|||
|
||||
def __call__(self, interface, **kw):
|
||||
schema = super(FileSchemaFactory, self).__call__(interface, **kw)
|
||||
if ('request' in kw and kw['request'].principal.id != 'rootadmin'
|
||||
and 'contentType' in schema.fields.keys()):
|
||||
del schema.fields['contentType']
|
||||
if 'request' in kw and kw['request'].principal.id != 'rootadmin':
|
||||
schema.fields.remove('contentType')
|
||||
return schema
|
||||
|
||||
|
||||
|
@ -56,8 +55,7 @@ class NoteSchemaFactory(SchemaFactory):
|
|||
|
||||
def __call__(self, interface, **kw):
|
||||
schema = super(NoteSchemaFactory, self).__call__(interface, **kw)
|
||||
del schema.fields['description']
|
||||
schema.fields.remove('description')
|
||||
schema.fields.data.height = 5
|
||||
return schema
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue