new method next_id(...) returns next primary key id
[plcapi.git] / PLC / Slices.py
index 1a1786c..5dcde46 100644 (file)
@@ -46,18 +46,6 @@ class Slice(Row):
        'nodes': [Mixed(Parameter(int, "Node identifier"),
                        Parameter(str, "Fully qualified hostname"))]
        }
-    # for Cache
-    class_key = 'name'
-    foreign_fields = ['instantiation', 'url', 'description', 'max_nodes', 'expires']
-    foreign_xrefs = [
-        {'field': 'node_ids' ,         'class': 'Node',   'table': 'slice_node' },
-       {'field': 'person_ids',        'class': 'Person', 'table': 'slice_person'},
-       {'field': 'creator_person_id', 'class': 'Person', 'table': 'unused-on-direct-refs'},
-        {'field': 'site_id',           'class': 'Site',   'table': 'unused-on-direct-refs'},
-    ]
-    # forget about this one, it is read-only anyway
-    # handling it causes Cache to re-sync all over again 
-    # 'created'
 
     def validate_name(self, name):
         # N.B.: Responsibility of the caller to ensure that login_base
@@ -195,12 +183,12 @@ class Slice(Row):
            updated_attributes = filter(lambda x: 'slice_attribute_id' in x, attributes)
 
            for added_attribute in added_attributes:
-               if 'attribute_type' in added_attribute:
-                   type = added_attribute['attribute_type']
-               elif 'attribute_type_id' in added_attribute:
-                   type = added_attribute['attribute_type_id']
+               if 'tag_type' in added_attribute:
+                   type = added_attribute['tag_type']
+               elif 'tag_type_id' in added_attribute:
+                   type = added_attribute['tag_type_id']
                else:
-                   raise PLCInvalidArgument, "Must specify attribute_type or attribute_type_id"
+                   raise PLCInvalidArgument, "Must specify tag_type or tag_type_id"
 
                if 'value' in added_attribute:
                    value = added_attribute['value']