def data(self): l1 = LogEventType("power on") l1.description = "Powers host on." l2 = LogEventType("power off") l2.description = "Powers host off." l3 = LogEventType("power status") l3.description = "Returns current power status."
def add_log_event_type(request, event_type, description=None): """Adds a new log event type. Returns: None Arguments: event_type -- the name of the event type. description -- a string describing the event type. Exceptions Raised: JinxInvalidStateError -- event_type already exists """ try: l = LogEventType(event_type) except NameException: return HttpResponseInvalidState("Event type '%s' already exists" % event_type) if description: l.description = description