+def get_section_id (section):
+ global section_id_cache
+
+ if section_id_cache.has_key(section):
+ return section_id_cache[section]
+
+ q = projectB.query("SELECT id FROM section WHERE section = '%s'" % (section))
+ ql = q.getresult();
+ if ql == []:
+ return -1;
+
+ section_id = ql[0][0];
+ section_id_cache[section] = section_id
+
+ return section_id
+
+def get_priority_id (priority):
+ global priority_id_cache
+
+ if priority_id_cache.has_key(priority):
+ return priority_id_cache[priority]
+
+ q = projectB.query("SELECT id FROM priority WHERE priority = '%s'" % (priority))
+ ql = q.getresult();
+ if ql == []:
+ return -1;
+
+ priority_id = ql[0][0];
+ priority_id_cache[priority] = priority_id
+
+ return priority_id
+
+def get_override_type_id (type):
+ global override_type_id_cache;
+
+ if override_type_id_cache.has_key(type):
+ return override_type_id_cache[type];
+
+ q = projectB.query("SELECT id FROM override_type WHERE type = '%s'" % (type));
+ ql = q.getresult();
+ if ql == []:
+ return -1;
+
+ override_type_id = ql[0][0];
+ override_type_id_cache[type] = override_type_id;
+
+ return override_type_id;
+