[Zope3-checkins] CVS: Zope3/src/zope/schema - interfaces.py:1.13
Gary Poster
gary@zope.com
Fri, 25 Apr 2003 16:41:11 -0400
Update of /cvs-repository/Zope3/src/zope/schema
In directory cvs.zope.org:/tmp/cvs-serv31306
Modified Files:
interfaces.py
Log Message:
Removed dependency I had introduced on app by trying to i18n-ify this. This obviously needs to be done in some other way that does not depend on app: I don't know what it is but perhaps others do.
=== Zope3/src/zope/schema/interfaces.py 1.12 => 1.13 ===
--- Zope3/src/zope/schema/interfaces.py:1.12 Thu Apr 24 16:51:58 2003
+++ Zope3/src/zope/schema/interfaces.py Fri Apr 25 16:41:10 2003
@@ -16,7 +16,6 @@
$Id$
"""
from zope.interface import Interface
-from zope.app.i18n import ZopeMessageIDFactory as _
class StopValidation(Exception):
"""This exception is raised, if the validation is done for sure early.
@@ -104,35 +103,35 @@
"""
title = TextLine(
- title=_(u"Title"),
- description=_(u"A short summary or label"),
+ title=u"Title",
+ description=u"A short summary or label",
default=u"",
required=False,
)
description = Text(
- title=_(u"Description"),
- description=_(u"A description of the field"),
+ title=u"Description",
+ description=u"A description of the field",
default=u"",
required=False,
)
required = Bool(
- title=_(u"Required"),
+ title=u"Required",
description=(
- _(u"tells whether a field requires its value to exist.")),
+ u"tells whether a field requires its value to exist."),
default=True)
readonly = Bool(
- title=_(u"Read Only"),
- description=_(u"Read-only."), # XXX what is this?
+ title=u"Read Only",
+ description=u"Read-only.", # XXX what is this?
required=False,
default=False)
default = Field(
- title=_(u"default field value if no value is present"),
- description=_(u"""The field default value may be None or a legal
- field value""")
+ title=u"default field value if no value is present",
+ description=u"""The field default value may be None or a legal
+ field value"""
)
def constraint(value):
@@ -153,15 +152,15 @@
"""
order = Int(
- title=_(u"Field Order"),
- description=_(u"""\
+ title=u"Field Order",
+ description=u"""\
The order attribute can be used to determine the order in
which fields in a schema were defined. If one field is created
after another (in the same thread), its order will be
greater.
(Fields in separate threads could have the same order.)
- """),
+ """,
required=True,
readonly=True,
)
@@ -219,13 +218,13 @@
"""
min = Field(
- title=_(u"Start of the range"),
+ title=u"Start of the range",
required=False,
default=None
)
max = Field(
- title=_(u"End of the range (excluding the value itself)"),
+ title=u"End of the range (excluding the value itself)",
required=False,
default=None
)
@@ -235,22 +234,22 @@
u"""a Field requiring the length of its value to be within a range"""
min_length = Int(
- title=_(u"Minimum length"),
- description=_(u"""\
+ title=u"Minimum length",
+ description=u"""\
Value after whitespace processing cannot have less than
min_length characters. If min_length is None, there is
no minimum.
- """),
+ """,
required=False,
min=0, # needs to be a positive number
default=0)
max_length = Int(
- title=_(u"Maximum length"),
- description=_(u"""\
+ title=u"Maximum length",
+ description=u"""\
Value after whitespace processing cannot have greater
or equal than max_length characters. If max_length is
- None, there is no maximum."""),
+ None, there is no maximum.""",
required=False,
min=0, # needs to be a positive number
default=None)
@@ -259,11 +258,11 @@
u"""Field whose value is contained in a predefined set"""
allowed_values = Container(
- title=_(u"Allowed Values"),
- description=_(u"""\
+ title=u"Allowed Values",
+ description=u"""\
Only values specified here can be values of this field.
If the list is empty, then there are no further
- restictions."""),
+ restictions.""",
required=False)
IValueSet = IEnumerated
@@ -351,12 +350,12 @@
"""
value_types = Iterable(
- title=_(u"Value Types"),
+ title=u"Value Types",
description=(
- _(u"""\
+ u"""\
If set to a non-empty value, field value items must conform to one
of the given types, which are expressed via fields.
- """)),
+ """),
required=False,
constraint=_fields,
)
@@ -375,22 +374,22 @@
"""
key_types = Iterable(
- title=_(u"Value Types"),
- description=_(u"""\
+ title=u"Value Types",
+ description=u"""\
If set to a non-empty value, field value keys must conform to one
of the given types, which are expressed via fields.
- """),
+ """,
constraint=_fields,
required=False,
)
value_types = Iterable(
- title=_(u"Value Types"),
+ title=u"Value Types",
description=(
- _(u"""\
+ u"""\
If set to a non-empty value, field value values must conform to one
of the given types, which are expressed via fields.
- """)),
+ """),
constraint=_fields,
required=False,
)