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

Class AccessArrayFaultHandler

         FaultHandler --+    
                        |    
AccessGenericFaultHandler --+
                            |
                           AccessArrayFaultHandler


Handles to-many relationships
Method Summary
  __init__(self, srcKeyGlobalID, relationshipName, aDatabaseContext, anEditingContext, object)
Initializes the fault handler with all the necessary informations needed to fetch rows from a database when the corresponding faulted object needs to be populated with its own data.
  __getattr__(self, name)
  completeInitializationOfObject(self, anObject)
See also: 'DatabaseContext.objectsForSourceGlobalID()'
  isFault(self)
Returns true or false, depending on the object internal state.
  relationshipName(self)
Returns the name of the source object's toMany relationship that fault handler is reponsible for.
  sourceGlobalID(self)
Returns the 'KeyGlobalID' identifying the source object for which that fault handler was created.
    Inherited from AccessGenericFaultHandler
  databaseContext(self)
Returns the 'DatabaseContext' object the fault handler uses to fetch data rows from a database.
  editingContext(self)
Returns the underlying EditingContext --see _setContext().
  faultWillFire(self, anObject)
Removes itself from the chain of handlers
  generation(self)
Return the ``generation'' of the fault --see: 'linkAfterHandler()'.
  linkAfterHandler(self, anAccessGenericFaultHandler, generation)
Adds the FaultHandler to the chain ended by 'anAccessGenericFaultHandler'.
  next(self)
Returns the successor of 'self' in the chain, or None.
  previous(self)
Returns the predecessor of 'self' in the chain, or None
  _handleECDeletion(self, ref)
Automatically called when the EditingContext the FaultHandler (weak-) references is deleted ; simply removes itself from the chain of handlers.
  _removeSelfFromChain(self)
Removes itself from the chain.
  _setContext(self, aDatabaseContext, anEditingContext)
Initializes the AccessGenericFaultHandler ; subclasses typically call this method in their '__init__()' method.
    Inherited from FaultHandler
  targetClass(self)

Class Variable Summary
    Inherited from AccessGenericFaultHandler
NoneType _dbContext = None                                                                  
int _generation = 0                                                                     
NoneType _next = None                                                                  
NoneType _previous = None                                                                  
NoneType _weakref_ec = None                                                                  

Method Details

__init__(self, srcKeyGlobalID, relationshipName, aDatabaseContext, anEditingContext, object)
(Constructor)

Initializes the fault handler with all the necessary informations needed to fetch rows from a database when the corresponding faulted object needs to be populated with its own data.

Parameters:

srcKeyGlobalID -- the 'KeyGlobalID' identifying the source object for
which the fault was created.
relationshipName -- the name of the toMany relationship this fault
handler services.
aDatabaseContext -- the 'DatabaseContext' object responsible for fetching
datas for this toMany fault
anEditingContext -- the 'EditingContext' holding the source object and
in which the objects

Implementation notes:

__TBD cf. besoin de violer la regle du fault qui ne contient pas son
__TBD objet, pour le cas des requetes sur __len__, etc. (sequence-like
__TBD messages)

__TBD It would be really better if faults could dynamically change
__TBD their class (python2.2: derive from lists) so that triggering the
__TBD fault automatically gives you the right thing
__TBD cf. e.g. EntityClassDescription.propagateDeleteForObject():
__TBD when processing toMany rels. it has to get the related objects
__TBD w/ storedValueForKey(), trigger the fault, and then re-get it
__TBD to get it right... That shouldnt be made that way. But is there
__TBD any way to do this right in python 2.1 ???

completeInitializationOfObject(self, anObject)

See also: 'DatabaseContext.objectsForSourceGlobalID()'
Overrides:
Modeling.FaultHandler.AccessGenericFaultHandler.completeInitializationOfObject

isFault(self)

Returns true or false, depending on the object internal state.

When the object is still a fault, returns 1. When the fault was triggered, this object acts as a proxy for the underlying sequence, and it returns 0 in this case.

This is needed during validation, when an object holds a toMany fault and validation needs to know whether this is a fault or not.

See also: Relationship.validateValue()

relationshipName(self)

Returns the name of the source object's toMany relationship that fault handler is reponsible for.

sourceGlobalID(self)

Returns the 'KeyGlobalID' identifying the source object for which that fault handler was created.

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