keep things simple, use 'value' rather than 'tagvalue' everywhere
[plcapi.git] / PLC / Nodes.py
index db62aae..c734a2b 100644 (file)
@@ -81,11 +81,13 @@ class Node(Row):
 
     view_tags_name = "view_node_tags"
     # tags declared here should also be defined as Accessors to ensure that the TagType is created
+    # type info not used yet
     tags = {
-        # regular
-        'arch': Parameter(str, "node/config", ro=True),
-        'deployment': Parameter(str, "node/operation"),
-        # dummynet
+        # regular nodes
+        'arch': str,
+        'pldistro' : str,
+        'deployment': str,
+        # dummynet nodes
         }
 
     def validate_hostname(self, hostname):
@@ -291,7 +293,8 @@ class Nodes(Table):
                 node_filter = Filter(Node.fields, {'node_id': ints, 'hostname': strs})
                 sql += " AND (%s) %s" % node_filter.sql(api, "OR")
             elif isinstance(node_filter, dict):
-                node_filter = Filter(Node.fields, node_filter)
+                allowed_fields=dict(Node.fields.items()+Node.tags.items())
+                node_filter = Filter(allowed_fields, node_filter)
                 sql += " AND (%s) %s" % node_filter.sql(api, "AND")
             elif isinstance (node_filter, StringTypes):
                 node_filter = Filter(Node.fields, {'hostname':[node_filter]})