Package Products :: Package ZenModel :: Module DeviceGroup |
[hide private]
[frames] | no frames]

# Source Code for Module Products.ZenModel.DeviceGroup

     1  ##############################################################################
     2  #
     3  # Copyright (C) Zenoss, Inc. 2007, 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  __doc__="""DeviceGroup
    12
    13
    14  $Id: DeviceGroup.py,v 1.15 2004/04/04 01:51:19 edahl Exp $"""
    15
    16  __version__ = "$Revision: 1.15 $"[11:-2]
    17
    18  from Globals import DTMLFile
    19  from Globals import InitializeClass
    20
    21  from Products.ZenRelations.RelSchema import *
    22
    23  from DeviceOrganizer import DeviceOrganizer
    24  from ZenPackable import ZenPackable
    25
    26 -def manage_addDeviceGroup(context, id, description = None, REQUEST = None):
    27      """make a DeviceGroup"""
    28      d = DeviceGroup(id, description)
    29      context._setObject(id, d)
    30
    31      if REQUEST is not None:
    32          REQUEST['RESPONSE'].redirect(context.absolute_url()
    33                                       +'/manage_main')
    34
    35
    36  addDeviceGroup = DTMLFile('dtml/addDeviceGroup',globals())
    37
    38
    39
    40 -class DeviceGroup(DeviceOrganizer, ZenPackable):
    41      """
    42      DeviceGroup is a DeviceGroup Organizer that allows generic device groupings.
    43      """
    44
    45      # Organizer configuration
    46      dmdRootName = "Groups"
    47
    48      portal_type = meta_type = event_key = 'DeviceGroup'
    49
    50      _relations = DeviceOrganizer._relations + ZenPackable._relations + (
    51          ("devices", ToMany(ToMany,"Products.ZenModel.Device","groups")),
    52          )
    53
    54  InitializeClass(DeviceGroup)
    55