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

# Source Code for Module Products.ZenModel.DeviceGroup

     1  ###########################################################################
     2  #
     3  # This program is part of Zenoss Core, an open source monitoring platform.
     4  # Copyright (C) 2007, Zenoss Inc.
     5  #
     6  # This program is free software; you can redistribute it and/or modify it
     7  # under the terms of the GNU General Public License version 2 or (at your
     8  # option) any later version as published by the Free Software Foundation.
     9  #
    10  # For complete information please visit: http://www.zenoss.com/oss/
    11  #
    12  ###########################################################################
    13
    14  __doc__="""DeviceGroup
    15
    16
    17  $Id: DeviceGroup.py,v 1.15 2004/04/04 01:51:19 edahl Exp $"""
    18
    19  __version__ = "$Revision: 1.15 $"[11:-2]
    20
    21  from Globals import DTMLFile
    22  from Globals import InitializeClass
    23
    24  from Products.ZenRelations.RelSchema import *
    25
    26  from DeviceOrganizer import DeviceOrganizer
    27  from ZenPackable import ZenPackable
    28
    29 -def manage_addDeviceGroup(context, id, description = None, REQUEST = None):
    30      """make a DeviceGroup"""
    31      d = DeviceGroup(id, description)
    32      context._setObject(id, d)
    33
    34      if REQUEST is not None:
    35          REQUEST['RESPONSE'].redirect(context.absolute_url()
    36                                       +'/manage_main')
    37
    38
    39  addDeviceGroup = DTMLFile('dtml/addDeviceGroup',globals())
    40
    41
    42
    43 -class DeviceGroup(DeviceOrganizer, ZenPackable):
    44      """
    45      DeviceGroup is a DeviceGroup Organizer that allows generic device groupings.
    46      """
    47
    48      # Organizer configuration
    49      dmdRootName = "Groups"
    50
    51      portal_type = meta_type = event_key = 'DeviceGroup'
    52
    53      _relations = DeviceOrganizer._relations + ZenPackable._relations + (
    54          ("devices", ToMany(ToMany,"Products.ZenModel.Device","groups")),
    55          )
    56
    57  InitializeClass(DeviceGroup)
    58