__all__.append('get_priority')
+def get_priorities(session=None):
+ """
+ Returns dictionary of priority names -> id mappings
+
+ @type session: Session
+ @param session: Optional SQL session object (a temporary one will be
+ generated if not supplied)
+
+ @rtype: dictionary
+ @return: dictionary of priority names -> id mappings
+ """
+ if session is None:
+ session = DBConn().session()
+
+ ret = {}
+ q = session.query(Priority)
+ for x in q.all():
+ ret[x.priority] = x.priority_id
+
+ return ret
+
+__all__.append('get_priorities')
+
################################################################################
class Queue(object):
__all__.append('get_section')
+def get_sections(session=None):
+ """
+ Returns dictionary of section names -> id mappings
+
+ @type session: Session
+ @param session: Optional SQL session object (a temporary one will be
+ generated if not supplied)
+
+ @rtype: dictionary
+ @return: dictionary of section names -> id mappings
+ """
+ if session is None:
+ session = DBConn().session()
+
+ ret = {}
+ q = session.query(Section)
+ for x in q.all():
+ ret[x.section] = x.section_id
+
+ return ret
+
+__all__.append('get_sections')
+
################################################################################
class DBSource(object):