AssistantEric/APIsManager.py

changeset 32
68ef15fe34c3
parent 30
8f4d794d8ee0
child 39
7b6ca9397ecc
diff -r ed537ef44f85 -r 68ef15fe34c3 AssistantEric/APIsManager.py
--- a/AssistantEric/APIsManager.py	Sat Jul 30 10:55:32 2011 +0200
+++ b/AssistantEric/APIsManager.py	Sun Sep 25 17:18:48 2011 +0200
@@ -397,6 +397,11 @@
         WHERE context = :context
         ORDER BY acWord
     """
+    ac_context_word_stmt = """
+        SELECT DISTINCT acWord, fullContext, pictureId FROM api
+        WHERE acWord GLOB :acWord AND context = :context
+        ORDER BY acWord
+    """
     ct_stmt = """
         SELECT DISTINCT acWord, signature, fullContext FROM api
         WHERE acWord = :acWord
@@ -606,7 +611,12 @@
             try:
                 query = None
                 
-                if start is not None:
+                if start is not None and context is not None:
+                    query = QSqlQuery(db)
+                    query.prepare(self.ac_context_word_stmt)
+                    query.bindValue(":acWord", start + '*')
+                    query.bindValue(":context", context)
+                elif start is not None:
                     query = QSqlQuery(db)
                     query.prepare(self.ac_stmt)
                     query.bindValue(":acWord", start + '*')

eric ide

mercurial