AssistantEric/APIsManager.py

changeset 32
68ef15fe34c3
parent 30
8f4d794d8ee0
child 39
7b6ca9397ecc
equal deleted inserted replaced
31:ed537ef44f85 32:68ef15fe34c3
395 ac_context_stmt = """ 395 ac_context_stmt = """
396 SELECT DISTINCT acWord, fullContext, pictureId FROM api 396 SELECT DISTINCT acWord, fullContext, pictureId FROM api
397 WHERE context = :context 397 WHERE context = :context
398 ORDER BY acWord 398 ORDER BY acWord
399 """ 399 """
400 ac_context_word_stmt = """
401 SELECT DISTINCT acWord, fullContext, pictureId FROM api
402 WHERE acWord GLOB :acWord AND context = :context
403 ORDER BY acWord
404 """
400 ct_stmt = """ 405 ct_stmt = """
401 SELECT DISTINCT acWord, signature, fullContext FROM api 406 SELECT DISTINCT acWord, signature, fullContext FROM api
402 WHERE acWord = :acWord 407 WHERE acWord = :acWord
403 """ 408 """
404 ct_context_stmt = """ 409 ct_context_stmt = """
604 if db.isOpen() and not self.__inPreparation: 609 if db.isOpen() and not self.__inPreparation:
605 db.transaction() 610 db.transaction()
606 try: 611 try:
607 query = None 612 query = None
608 613
609 if start is not None: 614 if start is not None and context is not None:
615 query = QSqlQuery(db)
616 query.prepare(self.ac_context_word_stmt)
617 query.bindValue(":acWord", start + '*')
618 query.bindValue(":context", context)
619 elif start is not None:
610 query = QSqlQuery(db) 620 query = QSqlQuery(db)
611 query.prepare(self.ac_stmt) 621 query.prepare(self.ac_stmt)
612 query.bindValue(":acWord", start + '*') 622 query.bindValue(":acWord", start + '*')
613 elif context is not None: 623 elif context is not None:
614 query = QSqlQuery(db) 624 query = QSqlQuery(db)

eric ide

mercurial