-# $Id$
#
# Thierry Parmentelat - INRIA
#
-# $Revision: 9423 $
-#
-
from PLC.Faults import *
from PLC.Method import Method
from PLC.TagTypes import TagType, TagTypes
from PLC.Auth import Auth
-can_update = lambda (field, value): field in \
- ['tagname', 'description', 'category', 'min_role_id']
+can_update = lambda field_value: field_value[0] in \
+ ['tagname', 'description', 'category']
class AddTagType(Method):
"""
roles = ['admin']
- tag_type_fields = dict(filter(can_update, TagType.fields.items()))
+ tag_type_fields = dict(list(filter(can_update, list(TagType.fields.items()))))
accepts = [
Auth(),
def call(self, auth, tag_type_fields):
- tag_type_fields = dict(filter(can_update, tag_type_fields.items()))
+ tag_type_fields = dict(list(filter(can_update, list(tag_type_fields.items()))))
tag_type = TagType(self.api, tag_type_fields)
tag_type.sync()
- self.object_ids = [tag_type['tag_type_id']]
+ self.object_ids = [tag_type['tag_type_id']]
return tag_type['tag_type_id']