[Zope3-dev] My Experiences using Interface invariants with Formlib

Jim Fulton jim at zope.com
Mon Jan 30 12:11:19 EST 2006


Fred Drake wrote:
> On 1/30/06, Michael Howitz <mh at gocept.com> wrote:
> 
>>I have an interface with two password fields which should be equal:
>>
>>class IUser(Interface):
>>    password=zope.schema.Password(title=u"password")
>>    password2=zope.schema.Password(title=u"password again")
> 
> 
> Gary outlined one approach, but I'll suggest another possibility anyway.
> 
> If the purpose of repeating the field is only to provide a "confirm
> password" field for the user interface, it may make sense to provide a
> new widget for Password fields that does all that itself, instead of
> putting that in the data model.
> 
> At that point, you have only one password field in your model, but the
> form can still deal with password double-entry in reasonable ways.

+10

Jim

-- 
Jim Fulton           mailto:jim at zope.com       Python Powered!
CTO                  (540) 361-1714            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org


More information about the Zope3-dev mailing list