[top] / zope / schema / interfaces / IField
Basic Schema Field Interface.
Fields are used for Interface specifications. They at least provide a title, description and a default value. You can also specify if they are required and/or readonly.
The Field Interface is also used for validation and specifying constraints.
We want to make it possible for a IField to not only work on its value but also on the object this value is bound to. This enables a Field implementation to perform validation against an object which also marks a certain place.
Note that many fields need information about the object containing a field. For example, when validating a value to be set as an object attribute, it may be necessary for the field to introspect the object's state. This means that the field needs to have access to the object when performing validation:
bound = field.bind(object) bound.validate(value)
default
*
-
Field
(default =
None
)
The field default value may be None or a legal field value
missing_value
*
-
Field
(default =
None
)
If input for this Field is missing, and that's ok, then this is the value to use
order
*
-
Int
(default =
None
)
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
*
-
Bool
(default =
True
)
Tells whether a field requires its value to exist.
description
-
Text
(default =
u''
)
A description of the field
readonly
-
Bool
(default =
False
)
If true, the field's value cannot be changed.
title
-
TextLine
(default =
u''
)
A short summary or label
* = required
set(object, value)
Set the value of the field for the object
Raises a type error if the field is a read-only field.
get(object)
Get the value of the field for the given object.
bind(object)
Return a copy of this field which is bound to context.
The copy of the Field will have the 'context' attribute set to 'object'. This way a Field can implement more complex checks involving the object's location/environment.
Many fields don't need to be bound. Only fields that condition validation or properties on an object containing the field need to be bound.
constraint(value)
Check a customized constraint on the value.
You can implement this method with your Field to require a certain constraint. This relaxes the need to inherit/subclass a Field you to add a simple constraint. Returns true if the given value is within the Field's constraint.
query(object, default=None)
Query the value of the field for the given object.
Return the default if the value hasn't been set.
validate(value)
Validate that the given value is a valid field value.
Returns nothing but raises an error if the value is invalid. It checks everything specific to a Field and also checks with the additional constraint.
There are no specific adapters registered for this interface.
There are no extended adapters registered for this interface.
zope.viewlet.metaconfigure.JavaScriptViewlet
(name: boston.js)
zope.viewlet.manager.<ViewletManager providing IJavaScript>
(name: zope.app.boston.IJavaScript)
zope.viewlet.viewlet.SimpleViewletClass from /opt/zope/sr/apidoc/src/zope/app/boston/viewlets/toolbar/viewlet.pt
(name: toolbar)
zope.traversing.namespace.lang
(name: lang)
zope.viewlet.manager.<ViewletManager providing ICSS>
(name: zope.app.boston.ICSS)
zope.traversing.namespace.acquire
(name: acquire)
zope.traversing.namespace.acquire
(name: acquire)
zope.traversing.namespace.acquire
(name: acquire)
zope.traversing.namespace.acquire
(name: acquire)
zope.app.apidoc.codemodule.browser.introspector.annotationsNamespace
(name: annotations)
zope.app.apidoc.codemodule.browser.introspector.annotationsNamespace
(name: annotations)
zope.app.apidoc.codemodule.browser.introspector.annotationsNamespace
(name: annotations)
zope.app.apidoc.codemodule.browser.introspector.annotationsNamespace
(name: annotations)
zope.viewlet.metaconfigure.CSSViewlet
(name: xmltree.css)
zope.app.pagetemplate.urlquote.URLQuote
(name: url)
zope.viewlet.viewlet.SimpleViewletClass from /opt/zope/sr/apidoc/src/zope/app/boston/viewlets/xmltree/xmltree.pt
(name: xmltree)
zope.viewlet.metaconfigure.CSSViewlet
(name: skin.css)
zope.app.preference.preference.preferencesNamespace
(name: preferences)
zope.app.preference.default.DefaultPreferences
(name: preferences)
zope.traversing.namespace.attr
(name: attribute)
zope.traversing.namespace.attr
(name: attribute)
zope.traversing.namespace.attr
(name: attribute)
zope.traversing.namespace.attr
(name: attribute)
zope.viewlet.manager.<ViewletManager providing IHead>
(name: zope.app.boston.IHead)
zope.app.component.back35.RegistrationManagerNamespace
(name: registrations)
zope.viewlet.manager.<ViewletManager providing ILeft>
(name: zope.app.boston.ILeft)
zope.traversing.namespace.resource
(name: resource)
zope.traversing.namespace.resource
(name: resource)
zope.traversing.namespace.resource
(name: resource)
zope.traversing.namespace.resource
(name: resource)
zope.traversing.namespace.etc
(name: etc)
zope.traversing.namespace.etc
(name: etc)
zope.traversing.namespace.etc
(name: etc)
zope.traversing.namespace.etc
(name: etc)
zope.traversing.namespace.etc
(name: etc)
zope.app.apidoc.apidoc.apidocNamespace
(name: apidoc)
zope.app.apidoc.apidoc.apidocNamespace
(name: apidoc)
zope.app.apidoc.apidoc.apidocNamespace
(name: apidoc)
zope.app.apidoc.apidoc.apidocNamespace
(name: apidoc)
zope.traversing.namespace.acquire
(name: acquire)
zope.traversing.namespace.lang
(name: lang)
zope.traversing.namespace.lang
(name: lang)
zope.traversing.namespace.lang
(name: lang)
zope.traversing.namespace.lang
(name: lang)
zope.traversing.namespace.item
(name: item)
zope.traversing.namespace.item
(name: item)
zope.traversing.namespace.item
(name: item)
zope.traversing.namespace.item
(name: item)
zope.traversing.namespace.item
(name: item)
zope.viewlet.metaconfigure.JavaScriptViewlet
(name: xmltree)
zope.viewlet.metaconfigure.CSSViewlet
(name: toolbar-css)
zope.traversing.namespace.adapter
(name: adapter)
zope.app.apidoc.apidoc.apidocNamespace
(name: apidoc)
zope.traversing.namespace.vh
(name: vh)
zope.traversing.namespace.vh
(name: vh)
zope.traversing.namespace.vh
(name: vh)
zope.traversing.namespace.vh
(name: vh)
zope.app.onlinehelp.helpNamespace
(name: help)
zope.app.onlinehelp.helpNamespace
(name: help)
zope.app.onlinehelp.helpNamespace
(name: help)
zope.app.onlinehelp.helpNamespace
(name: help)
zope.app.onlinehelp.helpNamespace
(name: help)
zope.traversing.namespace.adapter
(name: adapter)
zope.traversing.namespace.adapter
(name: adapter)
zope.traversing.namespace.adapter
(name: adapter)
zope.traversing.namespace.adapter
(name: adapter)
zope.traversing.namespace.debug
(name: debug)
zope.traversing.namespace.debug
(name: debug)
zope.traversing.namespace.debug
(name: debug)
zope.traversing.namespace.debug
(name: debug)
zope.app.pagetemplate.talesapi.ZopeTalesAPI
(name: zope)
zope.traversing.namespace.attr
(name: attribute)
zope.app.preference.preference.preferencesNamespace
(name: preferences)
zope.app.preference.preference.preferencesNamespace
(name: preferences)
zope.app.preference.preference.preferencesNamespace
(name: preferences)
zope.app.preference.preference.preferencesNamespace
(name: preferences)
zope.app.apidoc.codemodule.browser.introspector.annotationsNamespace
(name: annotations)
zope.traversing.namespace.view
(name: view)
zope.traversing.namespace.view
(name: view)
zope.traversing.namespace.view
(name: view)
zope.traversing.namespace.view
(name: view)
zope.formlib.namedtemplate.NamedTemplatePathAdapter
(name: template)
zope.viewlet.manager.<ViewletManager providing IToolBar>
(name: zope.app.boston.IToolBar)
zope.viewlet.metaconfigure.CSSViewlet
(name: widget.css)
There are no views available.
There are no views available.
There are no views available.
There are no views available.
There are no views available.
There are no views available.
There are no views available.
There are no views available.
There are no views available.
There are no views available.
There are no views available.
zope.schema._field.Object
zope.app.dav.interfaces.XMLText
zope.schema._bootstrapfields.Field
zope.schema._bootstrapfields.Password
zope.configuration.fields.MessageID
zope.schema._field.SourceText
zope.schema._field.Timedelta
zope.schema._field.Tuple
zope.configuration.fields.Tokens
zope.schema._field.ASCII
zope.schema._field.Datetime
zope.schema._field.Dict
zope.configuration.fields.Path
zope.configuration.fields.GlobalObject
zope.app.component.interfaces.registration.Component
zope.schema._field.DottedName
zope.app.component.back35.LayerField
zope.schema._field.InterfaceField
zope.schema._bootstrapfields.Int
zope.schema._bootstrapfields.Container
zope.schema._field.List
zope.schema._field.Time
zope.schema._field.Id
zope.schema._bootstrapfields.Bool
zope.schema._bootstrapfields.Iterable
zope.schema._field.FrozenSet
zope.configuration.fields.Bool
zope.schema._field.AbstractCollection
zope.configuration.fields.GlobalInterface
zope.schema._field.Set
zope.schema._field.BytesLine
zope.schema._field.Bytes
zope.schema._field.URI
zope.schema._field.ASCIILine
zope.schema._bootstrapfields.Text
zope.app.publisher.browser.fields.MenuField
zope.schema._field.Date
zope.configuration.fields.PythonIdentifier
zope.schema._field.Float
zope.security.zcml.Permission
zope.schema._field.Decimal
zope.schema._bootstrapfields.TextLine
zope.configuration.config.DirectiveSchema
zope.schema._field.Choice