Package zope :: Package schema :: Module _bootstrapfields :: Class Field
[show private | hide private]
[frames | no frames]

Type Field

object --+        
         |        
   Element --+    
             |    
     Attribute --+
                 |
                Field

Known Subclasses:
GlobalObject, Bool, Bytes, Choice, Container, Date, Datetime, Float, Int, InterfaceField, Object, Text, Timedelta

Method Summary
  __init__(self, title, description, __name__, required, readonly, constraint, default, missing_value)
Pass in field values as keyword parameters.
  __eq__(self, other)
  __ne__(self, other)
  _validate(self, value)
  bind(self, object)
  constraint(self, value)
  get(self, object)
  query(self, object, default)
  set(self, object, value)
  validate(self, value)
    Inherited from Element
  getDoc(self)
Returns the documentation for the object.
  getName(self)
Returns the name of the object.
  getTaggedValue(self, tag)
Returns the value associated with 'tag'.
  getTaggedValueTags(self)
Returns a list of all tags.
  queryTaggedValue(self, tag, default)
Returns the value associated with 'tag'.
  setTaggedValue(self, tag, value)
Associates 'value' with 'key'.
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __repr__(x)
x.__repr__() <==> repr(x)
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Class Variable Summary
Implements __implemented__ = <implementedBy zope.schema._bootstrapf...
ClassProvides __provides__ = <zope.interface.declarations.ClassProvide...
object _Field__missing_value_marker = <object object at 0xb7e6e...
NoneType _type = None                                                                  
NoneType context = None                                                                  
ValidatedProperty default = <zope.schema._bootstrapfields.ValidatedPropert...
FieldProperty description = <zope.schema.fieldproperty.FieldProperty o...
NoneType missing_value = None                                                                  
int order = 285                                                                   
FieldProperty readonly = <zope.schema.fieldproperty.FieldProperty obje...
FieldProperty required = <zope.schema.fieldproperty.FieldProperty obje...
FieldProperty title = <zope.schema.fieldproperty.FieldProperty object ...
    Inherited from Attribute
NoneType interface = None                                                                  
    Inherited from Element
ClassProvides __providedBy__ = <zope.interface.declarations.ClassProvi...

Method Details

__init__(self, title=u'', description=u'', __name__='', required=True, readonly=False, constraint=None, default=None, missing_value=<object object at 0xb7e6e450>)
(Constructor)

Pass in field values as keyword parameters.

Generally, you want to pass either a title and description, or a doc string. If you pass no doc string, it will be computed from the title and description. If you pass a doc string that follows the Python coding style (title line separated from the body by a blank line), the title and description will be computed from the doc string. Unfortunately, the doc string must be passed as a positional argument.

Here are some examples:

>>> f = Field()
>>> f.__doc__, f.title, f.description
('', u'', u'')
>>> f = Field(title=u'sample')
>>> f.__doc__, f.title, f.description
(u'sample', u'sample', u'')
>>> f = Field(title=u'sample', description=u'blah blah\nblah')
>>> f.__doc__, f.title, f.description
(u'sample\n\nblah blah\nblah', u'sample', u'blah blah\nblah')
Overrides:
zope.interface.interface.Element.__init__

Class Variable Details

__implemented__

Type:
Implements
Value:
<implementedBy zope.schema._bootstrapfields.Field>                     

__provides__

Type:
ClassProvides
Value:
<zope.interface.declarations.ClassProvides object at 0xb651252c>       

_Field__missing_value_marker

Type:
object
Value:
<object object at 0xb7e6e450>                                          

_type

Type:
NoneType
Value:
None                                                                  

context

Type:
NoneType
Value:
None                                                                  

default

Type:
ValidatedProperty
Value:
<zope.schema._bootstrapfields.ValidatedProperty object at 0xb650b64c>  

description

Type:
FieldProperty
Value:
<zope.schema.fieldproperty.FieldProperty object at 0xb650570c>         

missing_value

Type:
NoneType
Value:
None                                                                  

order

Type:
int
Value:
285                                                                   

readonly

Type:
FieldProperty
Value:
<zope.schema.fieldproperty.FieldProperty object at 0xb650734c>         

required

Type:
FieldProperty
Value:
<zope.schema.fieldproperty.FieldProperty object at 0xb6505cec>         

title

Type:
FieldProperty
Value:
<zope.schema.fieldproperty.FieldProperty object at 0xb650534c>         

Generated by Epydoc 2.1 on Fri Jun 24 12:01:25 2005 http://epydoc.sf.net