A PropertySheet is an abstraction for organizing and working with a set of related properties. Conceptually it acts like a container for a set of related properties and meta-data describing those properties. A PropertySheet may or may not provide a web interface for managing its properties.
Returns true if self
has a property with the given id
,
false otherwise.
Access contents information
Get the property id
, returning the optional second
argument or None if no such property is found.
Returns a tuple of mappings, giving meta-data for properties.
Change existing object properties by passing either a mapping
object as REQUEST
containing name:value pairs or by passing
name=value keyword arguments.
Some objects have "special" properties defined by product authors that cannot be changed. If you try to change one of these properties through this method, an error will be raised.
Note that no type checking or conversion happens when this method is called, so it is the caller's responsibility to ensure that the updated values are of the correct type. This should probably change.
If a value is provided for REQUEST
(as it will be when
called via the web), the method will return an HTML message
dialog. If no REQUEST is passed, the method returns None
on
success.
This method may be called via the web, from DTML or from Python code.
Manage Properties
Delete one or more properties with the given ids
. The ids
argument should be a sequence (tuple or list) containing the
ids of the properties to be deleted. If ids
is empty no
action will be taken. If any of the properties named in ids
does not exist, an error will be raised.
Some objects have "special" properties defined by product
authors that cannot be deleted. If one of these properties is
named in ids
, an HTML error message is returned.
If no value is passed in for REQUEST
, the method will return
None. If a value is provided for REQUEST
(as it will be when
called via the web), the property management form for the
object will be rendered and returned.
This method may be called via the web, from DTML or from Python code.
Manage Properties
Add a new property with the given id
, value
and type
.
These are the property types:
boolean
date
DateTime
value, for example 12/31/1999 15:42:52 PST
.float
12.4
.int
12
.lines
long
12232322322323232323423
.string
This is a string
.text
tokens
one two three
.selection
multiple selection
This method will use the passed in type
to try to convert
the value
argument to the named type. If the given value
cannot be converted, a ValueError will be raised.
The value given for selection
and multiple selection
properites may be an attribute or method name. The attribute
or method must return a sequence values.
If the given type
is not recognized, the value
and type
given are simply stored blindly by the object.
If no value is passed in for REQUEST
, the method will return
None
. If a value is provided for REQUEST
(as it will when
called via the web), the property management form for the
object will be rendered and returned.
This method may be called via the web, from DTML or from Python code.
Manage Properties
Returns a mapping containing property meta-data.
Get the type of property id
. Returns None if no such
property exists.
Returns a list of property ids.
Access contents information
Returns a list of actual property values.
Access contents information
Return a list of (id, property) tuples.
Access contents information
Return a namespace string usable as an xml namespace for this property set. This may be an empty string if there is no default namespace for a given property sheet (especially property sheets added in ZClass definitions).