Package Products :: Package ZenRelations :: Module subscribers |
[hide private]
[frames] | no frames]

# Source Code for Module Products.ZenRelations.subscribers

     1  ##############################################################################
     2  #
     3  # Copyright (C) Zenoss, Inc. 2009, all rights reserved.
     4  #
     5  # This content is made available according to terms specified in
     6  # License.zenoss under the directory where your Zenoss product is installed.
     7  #
     8  ##############################################################################
     9
    10
    11  from Products.ZenRelations.ToOneRelationship import ToOneRelationship
    12
    13
    14 -def cleanUpRelationships(ob, event):
    15      """
    16      Unlinks non-container relationships when their targets are being deleted.
    17      """
    18      if getattr(event.object, "_operation", -1) < 1:
    19          # Don't bother in the case where the other side is a container.
    20          if not (isinstance(ob, ToOneRelationship) and
    21              ob.remoteTypeName() == 'ToManyCont'):
    22              ob._remoteRemove()
    23
    24
    25 -def resetUnderscoreOperation(ob, event):
    26      """
    27      Make sure that the _operation attribute on a RelationshipManager is reset
    28      after paste/move/rename.
    29      """
    30      if ob._operation > -1: ob._operation = -1
    31