[Zope3-checkins] CVS: Zope3/src/zope/schema - errornames.py:1.3
Stuart Bishop
zen@shangri-la.dropbear.id.au
Mon, 14 Jul 2003 11:28:41 -0400
Update of /cvs-repository/Zope3/src/zope/schema
In directory cvs.zope.org:/tmp/cvs-serv24906/src/zope/schema
Modified Files:
errornames.py
Log Message:
- Make Widget validation errors humanly readable, it a half-arsed sort of way.
Widgets have spawned an 'error' attribute, set by getData.
- Display validation errors next to the dud input in Widget.row()
- Make description a tooltip of a Widget's label. This is currently done
by abusing the <acronym> tag.
- addwizard and editwizard work again with the recent editview changes
=== Zope3/src/zope/schema/errornames.py 1.2 => 1.3 ===
--- Zope3/src/zope/schema/errornames.py:1.2 Wed Dec 25 09:15:20 2002
+++ Zope3/src/zope/schema/errornames.py Mon Jul 14 11:28:35 2003
@@ -14,29 +14,36 @@
"""Common Schema Error Names
$Id$
+
+Defines common validation error messages.
+Using these symbols instead of strings makes unit tests less fragile,
+as the strings are only defined in one place. Otherwise, this module
+serves no real function.
"""
-WrongType = u"WrongType"
+from zope.app.i18n import ZopeMessageIDFactory as _
+
+WrongType = _(u'Wrong type')
-RequiredMissing = u'RequiredMissing'
+RequiredMissing = _(u'Input is required') # Required input missing
-RequiredEmptyStr = u'RequiredEmptyString'
+RequiredEmptyStr = _(u'Required empty string')
-TooBig = u'TooBig'
+TooBig = _(u'Too big')
-TooSmall = u'TooSmall'
+TooSmall = _(u'Too small')
-TooLong = u'TooLong'
+TooLong = _(u'Too long')
-TooShort = u'TooShort'
+TooShort = _(u'Too short')
-InvalidValue = u'InvalidValue'
+InvalidValue = _(u'Invalid value')
-TooManyDecimals = u'TooManyDecimals'
+TooManyDecimals = _(u'Too many decimals')
-WrongContainedType = u"WrongContainedType"
+WrongContainedType = _(u"Wrong contained type")
-ConstraintNotSatisfied = u'ConstraintNotSatisfied'
+ConstraintNotSatisfied = _(u'Constraint not satisfied')
-NotAContainer = u'NotAContainer'
+NotAContainer = _(u'Not a container')
-NotAnIterator = u'NotAnIterator'
+NotAnIterator = _(u'Not an iterator')