Package Modeling :: Module Model :: Class Model
[show private | hide private]
[frames | no frames]

Type Model

KeyValueCoding --+
                 |
        object --+
                 |
 XMLCapability --+
                 |
                Model


Describes a model
Method Summary
  __init__(self, aName)
Initializes a model.
  adaptorName(self)
Returns the DB adaptor name.
  addEntity(self, anEntity)
Adds 'anEntity' to the model, and silently returns if 'anEntity' is already registered within the Model.
  cacheSimpleMethods(self)
Iterates on entities, entities' attributes and relationships, and self, and caches the result of methods taking only one argument ('self').
  comment(self)
Returns the comment field
  connectionDictionary(self)
Returns the connection dictionary
  entities(self)
Returns the whole set of attributes
  entitiesNames(self)
Returns the whole set ('tuple') of entities' name.
  entityForObject(self, aDatabaseObject)
Returns the entity corresponding to the supplied object, or 'None' if it cannot be found
  entityNamed(self, aName)
Returns the entity named 'aName' or None if it does not exist.
  getXMLDOM(self, doc, parentNode, encoding)
Returns the (DOM) DocumentObject for the receiver.
  handleAssignementForUnboundKey(self, value, key)
See interfaces.KeyValueCoding for details
  handleTakeStoredValueForUnboundKey(self, value, key)
See interfaces.KeyValueCoding for details
  initWithXMLDOMNode(self, aNode, encoding)
Initializes a model with the supplied xml.dom.node.
  isEntityNameDeclaredInNamespace(self, aName)
Checks whether the name is already registered within the model or its ModelSet if it has one.
  modelSet(self)
Returns the parent Modeling.ModelSet
  name(self)
Returns the Model's name
  packageName(self)
Returns the name of the package that will be used when generating code templates for that model
  removeEntity(self, anEntity)
Removes the supplied entity from the registered entities.
  removeEntityAndReferences(self, anEntity)
UNIMPLEMENTED Removes the supplied entity from the registered entities, as well as all related relationships in other registered entities.
  saveModelAsXMLFile(self, xmlFilePath, encoding)
Saves the model in specified file --xml-formatted
  setAdaptorName(self, adaptorName)
Sets the DB adaptor name
  setComment(self, aComment)
Sets the comment field
  setConnectionDictionary(self, aConnectionDictionary)
Sets the connection dictionary
  setName(self, aName)
Sets the model's name.
  setPackageName(self, packageName)
Sets the name of the package that will be used when generating code templates for that model
  validateObject(self, aModel)
Checks whether the supplied object is valid
  xmlAttributesDict(self)
.
    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)
    Inherited from XMLCapability
  getXMLNodeName(self)
Returns the node name corresponding to the receiver
  xmlAttributeType(self, attributeName)
  xmlGetAttribute(self, attributeName)
  xmlSetAttribute(self, attributeName)
    Inherited from KeyValueCoding
  handleQueryWithUnboundKey(self, key)
See interfaces.KeyValueCoding for details
  setStoredValueForKey(self, value, key)
DEPRECATED -- alias for 'takeStoredValueForKey()'
  setValueForKey(self, value, key)
DEPRECATED -- alias for takeValueForKey()
  setValueForKeyPath(self, value, keypath)
DEPRECATED -- alias for takeValueForKeyPath()
  storedValueForKey(self, key)
See interfaces.KeyValueCoding for details
  takeStoredValueForKey(self, value, key)
See interfaces.KeyValueCoding for details
  takeStoredValuesFromDictionary(self, dictionary)
See interfaces.KeyValueCoding for details
  takeValueForKey(self, value, key)
See interfaces.KeyValueCoding for details
  takeValueForKeyPath(self, value, key)
See interfaces.KeyValueCoding for details
  takeValuesFromDictionary(self, dictionary)
See interfaces.KeyValueCoding for details
  valueForKey(self, key)
See interfaces.KeyValueCoding for details
  valueForKeyPath(self, keypath)
See interfaces.KeyValueCoding for details
  valuesForKeys(self, keys)
See interfaces.KeyValueCoding for details

Class Variable Summary
    Inherited from KeyValueCoding
tuple __implements__ = (<class Modeling.interfaces.KeyValueCod...

Method Details

__init__(self, aName='')
(Constructor)

Initializes a model. A name must be provided.
Overrides:
__builtin__.object.__init__

adaptorName(self)

Returns the DB adaptor name. It may be None.

addEntity(self, anEntity)

Adds 'anEntity' to the model, and silently returns if 'anEntity' is already registered within the Model.

Raises 'ModelError' if the anEntity's name is already used by an other entity in the model or its ModelSet.

cacheSimpleMethods(self)

Iterates on entities, entities' attributes and relationships, and self, and caches the result of methods taking only one argument ('self').

This needs to be enabled by setting the environment variable MDL_ENABLE_SIMPLE_METHOD_CACHE to any non-empty string; you want to leave it disabled when you manipulate models at runtime, for example in a model designer.

See: Modeling.utils.cache_simple_methods

comment(self)

Returns the comment field

connectionDictionary(self)

Returns the connection dictionary

entities(self)

Returns the whole set of attributes

entitiesNames(self)

Returns the whole set ('tuple') of entities' name.

entityForObject(self, aDatabaseObject)

Returns the entity corresponding to the supplied object, or 'None' if it cannot be found

entityNamed(self, aName)

Returns the entity named 'aName' or None if it does not exist.

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.

Overrides:
Modeling.XMLutils.XMLCapability.getXMLDOM

handleAssignementForUnboundKey(self, value, key)

See interfaces.KeyValueCoding for details
Overrides:
Modeling.KeyValueCoding.KeyValueCoding.handleAssignementForUnboundKey (inherited documentation)

handleTakeStoredValueForUnboundKey(self, value, key)

See interfaces.KeyValueCoding for details
Overrides:
Modeling.KeyValueCoding.KeyValueCoding.handleAssignementForUnboundKey (inherited documentation)

initWithXMLDOMNode(self, aNode, encoding='iso-8859-1')

Initializes a model with the supplied xml.dom.node.

A XMLutils.XMLImportError is raised if the model is not empty, i.e. if it already holds some entities

isEntityNameDeclaredInNamespace(self, aName)

Checks whether the name is already registered within the model or its ModelSet if it has one.

modelSet(self)

Returns the parent Modeling.ModelSet

name(self)

Returns the Model's name

packageName(self)

Returns the name of the package that will be used when generating code templates for that model

removeEntity(self, anEntity)

Removes the supplied entity from the registered entities. Parameter 'anEntity' can be either an 'Entity' instance or a subentity's name. No referential checks are done. Raises 'ModelError' if 'anEntity' cannot be found.

removeEntityAndReferences(self, anEntity)

UNIMPLEMENTED Removes the supplied entity from the registered entities, as well as all related relationships in other registered entities.

saveModelAsXMLFile(self, xmlFilePath, encoding='iso-8859-1')

Saves the model in specified file --xml-formatted

setAdaptorName(self, adaptorName)

Sets the DB adaptor name

setComment(self, aComment)

Sets the comment field

setConnectionDictionary(self, aConnectionDictionary)

Sets the connection dictionary

setName(self, aName)

Sets the model's name. Raises if invalid

setPackageName(self, packageName)

Sets the name of the package that will be used when generating code templates for that model

validateObject(self, aModel)

Checks whether the supplied object is valid

xmlAttributesDict(self)

.
Overrides:
Modeling.XMLutils.XMLCapability.xmlAttributesDict

Generated by Epydoc 2.1 on Sat Mar 4 13:36:21 2006 http://epydoc.sf.net