Module queryStore |
[hide private]
[frames] | no frames]

## Source Code for Module queryStore

     1
     2  from baseObjects import QueryStore
     3  from baseStore import BdbStore
     4  from PyZ3950.CQLParser import parse
     5
     6 -class SimpleQueryStore(BdbStore, QueryStore):
     7
     8 -    def create_query(self, session, query=None):
     9          # Create a record like <query> text </query>
    10          data = query.toCQL()
    11          id = self.generate_id(session)
    12          self.store_data(session, id, data)
    13          return id
    14
    15 -    def delete_query(self, session, id):
    16          self.delete_item(session, id)
    17
    18 -    def fetch_query(self, session, id):
    19          cql = self.fetch_data(session, id)
    20          return parse(cql)
    21
    22 -    def store_query(self, session, query):
    23          # Where to get ID from???
    24          raise NotImplementedError
    25          r = self.store_record(session, rec)
    26          return id
    27