Home | Trees | Index | Help |
|
---|
Package Modeling :: Module Attribute :: Class Attribute |
|
KeyValueCoding
--+ |object
--+ |XMLCapability
--+ | Attribute
Method Summary | |
---|---|
Initializes an attribute. | |
Returns a printable representation of the attribute ; the format is <entityName>.<attributeName>. | |
Indicates whether the attribute can be empty (None) or not (see isRequired inverse method) | |
Indicates whether the attribute can be empty (None) or not (see isRequired inverse method) | |
Returns all available type names, as a tuple | |
Returns all available types | |
Returns a copy of the current Attribute | |
... | |
Returns the comment field | |
Internally used to convert a string value (taken from a GUI, for example) to the correct type. | |
Returns the default value associated to this attribute | |
Returns the default value in a string that can be used in python code, e.g. | |
Returns the definition for a flattened or derived attribute | |
Returns the label associated to the current attribute | |
Returns the associated 'Entity' | |
externalType(self)
| |
Returns the final attribute pointed by a flattened attribute. | |
flattenedPropertySet(self)
| |
fullPropertySet(self)
| |
Returns the (DOM) DocumentObject for the receiver. | |
See interfaces.KeyValueCoding for details | |
See interfaces.KeyValueCoding for details | |
Initializes a model with the supplied xml.dom.node. | |
Indicates whether the attribute belongs to the class properties/fields | |
Tells whether the attribute is derived. | |
Indicates whether the attribute is flattened | |
negation of isClassProperty | |
Returns whether the attribute is required (see also: allowsNone) | |
Returns the attribute's name | |
nonDerivedPropertySet(self)
| |
Returns the associated 'Entity' | |
precision(self)
| |
Simply returns the attribute's columnName() | |
Returns the relationshipPath (string) for a flattened attribute, or None if the attribute is not flattened | |
Returns the list ('tuple')of Relationship objects that should be traversed to obtain the finalAttribute(), or None if the attribute is not flattened | |
scale(self)
| |
Tells the attribute whether it may have 'None' value or not (see inverse method setIsRequired) | |
... | |
Sets the comment field | |
Sets the default value associated to this attribute | |
Sets the definition for a flattened or derived attribute | |
Sets the label associated to the attribute | |
setExternalType(self,
externalType)
| |
Tells the receiver whether it belongs to the class properties/fields | |
Tells the attribute that it is flattened See also: setDefinition() | |
Tells the attribute whether is required or not (inverse of setAllowNone) | |
Sets the attribute's name. | |
setPrecision(self,
precision)
| |
setScale(self,
scale)
| |
Sets the type associated to the attribute. | |
Sets the maximum size for that attribute | |
Returns the type associated to the attribute. | |
Validates the attributes against general model consistency: - attribute cannot be both public and catalogable - defaultValue should have the correct type - no columnName() for flattened attributes - etc. | |
Checks whether the supplied object is valid, i.e. | |
Returns the maximum width for this attribute. | |
| |
Inherited from object | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
x.__hash__() <==> hash(x) | |
T.__new__(S, ...) -> a new object with type S, a subtype of T | |
helper for pickle | |
helper for pickle | |
x.__repr__() <==> repr(x) | |
x.__setattr__('name', value) <==> x.name = value | |
Inherited from XMLCapability | |
Returns the node name corresponding to the receiver | |
| |
| |
| |
Inherited from KeyValueCoding | |
See interfaces.KeyValueCoding for details | |
DEPRECATED -- alias for 'takeStoredValueForKey()' | |
DEPRECATED -- alias for takeValueForKey() | |
DEPRECATED -- alias for takeValueForKeyPath() | |
See interfaces.KeyValueCoding for details | |
See interfaces.KeyValueCoding for details | |
See interfaces.KeyValueCoding for details | |
See interfaces.KeyValueCoding for details | |
See interfaces.KeyValueCoding for details | |
See interfaces.KeyValueCoding for details | |
See interfaces.KeyValueCoding for details | |
See interfaces.KeyValueCoding for details | |
See interfaces.KeyValueCoding for details |
Class Variable Summary | |
---|---|
Inherited from KeyValueCoding | |
tuple |
__implements__ = (<class Modeling.interfaces.KeyValueCod...
|
Method Details |
---|
__init__(self,
aName='',
anEntity=None)
Initializes an attribute. A name must be provided. |
__str__(self)
Returns a printable representation of the attribute ; the format is
<entityName>.<attributeName>.
If self.entity() is not already set, then it returns None.
Note: this string uniquely identificates an attribute in a given ModelSet
or Model since entities'names share the same namespace |
allowsNone(self)Indicates whether the attribute can be empty (None) or not (see isRequired inverse method) |
allowsNull(self)Indicates whether the attribute can be empty (None) or not (see isRequired inverse method) |
availableIndexTypeNames(self)Returns all available type names, as a tuple |
availableTypes(self)Returns all available types |
clone(self, name=None)Returns a copy of the current Attribute Parameter: name -- optional. If provided the clone gets that name, otherwise defaults to 'self.name()'. See also: Entity.clone() |
columnName(self)... |
comment(self)Returns the comment field |
convertStringToAttributeType(self, aValue)Internally used to convert a string value (taken from a GUI, for example) to the correct type. See: setDefaultValue() |
defaultValue(self)Returns the default value associated to this attribute |
defaultValueAsPythonStatement(self)Returns the default value in a string that can be used in python code, e.g. in assignments This is mainly for use in the generation of templates of code |
definition(self)Returns the definition for a flattened or derived attribute |
displayLabel(self)Returns the label associated to the current attribute |
entity(self)Returns the associated 'Entity' |
finalAttribute(self)Returns the final attribute pointed by a flattened attribute. Returns None if none can be found, or if the attribute is not flattened
|
getXMLDOM(self, doc=None, parentNode=None, encoding='iso-8859-1')Returns the (DOM) DocumentObject for the receiver. Parameters 'doc' and 'parentDoc' should be both omitted or supplied. If they are omitted, a new DocumentObject is created. If they are supplied, elements are added to the parentNode. Returns: the (possibly new) DocumentObject.
|
handleAssignementForUnboundKey(self, value, key)See interfaces.KeyValueCoding for details
|
handleTakeStoredValueForUnboundKey(self, value, key)See interfaces.KeyValueCoding for details
|
initWithXMLDOMNode(self, aNode, encoding='iso-8859-1')Initializes a model with the supplied xml.dom.node. |
isClassProperty(self)Indicates whether the attribute belongs to the class properties/fields |
isDerived(self)Tells whether the attribute is derived. Note that a flattened attribute is also considered derived |
isFlattened(self)Indicates whether the attribute is flattened |
isNotClassProperty(self)negation of isClassProperty |
isRequired(self)Returns whether the attribute is required (see also: allowsNone) |
name(self)Returns the attribute's name |
parent(self)Returns the associated 'Entity' |
readFormat(self)Simply returns the attribute's columnName() |
relationshipPath(self)Returns the relationshipPath (string) for a flattened attribute, or None if the attribute is not flattened The relationshipPath consists of the definition() from which the last part (which designates the finalAttribute()) is stripped off. For example, the relationshipPath for an attribute whose definition is 'relationship1.relationship2.attribute' is 'relationship1.relationship2'.
|
relationshipPathObjects(self)Returns the list ('tuple')of Relationship objects that should be traversed to obtain the finalAttribute(), or None if the attribute is not flattened
|
setAllowsNone(self, allowsNone)Tells the attribute whether it may have 'None' value or not (see inverse method setIsRequired) |
setColumnName(self, columnName)... |
setComment(self, aComment)Sets the comment field |
setDefaultValue(self, aValue)Sets the default value associated to this attribute |
setDefinition(self, definition)Sets the definition for a flattened or derived attribute |
setDisplayLabel(self, aName)Sets the label associated to the attribute |
setIsClassProperty(self, aBool)Tells the receiver whether it belongs to the class properties/fields |
setIsFlattened(self, aBool)Tells the attribute that it is flattened See also: setDefinition() |
setIsRequired(self, isRequired)Tells the attribute whether is required or not (inverse of setAllowNone) |
setName(self, aName)Sets the attribute's name. Raises if invalid |
setType(self, aType, check=1)Sets the type associated to the attribute. aType object should be an available type's name (see Modeling.Attribute.availableTypes() for a complete list Specify 'check=0' if you do not want the 'defaultValue' to be verified against the new type. |
setWidth(self, width)Sets the maximum size for that attribute |
type(self)Returns the type associated to the attribute. |
validateAttribute(self)Validates the attributes against general model consistency: - attribute cannot be both public and catalogable - defaultValue should have the correct type - no columnName() for flattened attributes - etc. TBD |
validateValue(self, value, object=None)Checks whether the supplied object is valid, i.e. the following tests are made:
Parameter 'value' is required, and 'object' is optional --it is only used to make the error message clearer in case of failure. Silently returns if it succeeds. In case of failure, it raises 'Modeling.Validation.ValidationException' ; in this case, exception's value ('sys.exc_info[1]') consists in a set of lines, describing line per line the different tests which failed. |
width(self)Returns the maximum width for this attribute. Should be '0' (zero) for date and numbers |
xmlAttributesDict(self, select=0) |
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Sat Mar 4 13:36:27 2006 | http://epydoc.sf.net |