From aaf86d4ec9046ef885710edb5daec74b019a9d2a Mon Sep 17 00:00:00 2001 From: helmutm Date: Fri, 4 Sep 2009 16:10:40 +0000 Subject: [PATCH] provide a display renderer for password fields that does not show the field content git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@3531 fd906abe-77d9-0310-91a1-e0d9ade77398 --- composer/schema/factory.py | 1 + composer/schema/interfaces.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/composer/schema/factory.py b/composer/schema/factory.py index a736b71..8f04f06 100644 --- a/composer/schema/factory.py +++ b/composer/schema/factory.py @@ -39,6 +39,7 @@ class Email(schema.TextLine): # put field type name and other info in standard field classes. schema.Field.__typeInfo__ = ('textline',) +schema.Password.__typeInfo__ = ('password',) schema.Int.__typeInfo__ = ('number',) schema.Float.__typeInfo__ = ('number',) schema.Choice.__typeInfo__ = ('dropdown',) diff --git a/composer/schema/interfaces.py b/composer/schema/interfaces.py index 77aa477..b8aaa7a 100644 --- a/composer/schema/interfaces.py +++ b/composer/schema/interfaces.py @@ -85,7 +85,8 @@ class FieldType(SimpleTerm): # TODO: register this object as a utility providing IFieldTypes fieldTypes = SimpleVocabulary(( FieldType('textline', 'textline', u'Textline'), - FieldType('password', 'password', u'Password'), + FieldType('password', 'password', u'Password', + displayRenderer='display_password'), FieldType('textarea', 'textarea', u'Textarea'), FieldType('html', 'html', u'HTML Text'), FieldType('number', 'number', u'Number',