Package zope :: Package schema :: Module _field :: Class Id
[show private | hide private]
[frames | no frames]

Type Id

object --+                    
         |                    
   Element --+                
             |                
     Attribute --+            
                 |            
             Field --+        
                     |        
        object --+   |        
                 |   |        
         MinMaxLen --+        
                     |        
                 Bytes --+    
                         |    
                 BytesLine --+
                             |
                            Id


Id field

Values of id fields must be either uris or dotted names.


Method Summary
  _validate(self, value)
  fromUnicode(self, value)
    Inherited from BytesLine
  constraint(self, value)
    Inherited from MinMaxLen
  __init__(self, min_length, max_length, **kw)
    Inherited from Field
  __eq__(self, other)
  __ne__(self, other)
  bind(self, object)
  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._field.Id>
ClassProvides __provides__ = <zope.interface.declarations.ClassProvide...
    Inherited from MinMaxLen
ClassProvides __providedBy__ = <zope.interface.declarations.ClassProvi...
FieldProperty max_length = <zope.schema.fieldproperty.FieldProperty ob...
FieldProperty min_length = <zope.schema.fieldproperty.FieldProperty ob...
    Inherited from Field
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                                                                  

Method Details

_validate(self, value)

>>> id = Id(__name__='test')
>>> id.validate("http://www.python.org/foo/bar")
>>> id.validate("zope.app.content")
>>> id.validate("zope.app.content/a")
Traceback (most recent call last):
...
InvalidId: zope.app.content/a
>>> id.validate("http://zope.app.content x y")
Traceback (most recent call last):
...
InvalidId: http://zope.app.content x y
Overrides:
zope.schema._bootstrapfields.MinMaxLen._validate

fromUnicode(self, value)

>>> id = Id(__name__='test')
>>> id.fromUnicode("http://www.python.org/foo/bar")
'http://www.python.org/foo/bar'
>>> id.fromUnicode(u" http://www.python.org/foo/bar ")
'http://www.python.org/foo/bar'
>>> id.fromUnicode("http://www.python.org/ foo/bar")
Traceback (most recent call last):
...
InvalidId: http://www.python.org/ foo/bar
>>> id.fromUnicode("      \n x.y.z \n")
'x.y.z'
Overrides:
zope.schema._field.Bytes.fromUnicode

Class Variable Details

__implemented__

Type:
Implements
Value:
<implementedBy zope.schema._field.Id>                                  

__provides__

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

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