Commit 03a0580b authored by Administrator's avatar Administrator

[CODE] Variable in SQL for cooc.

parent ef535289
...@@ -69,7 +69,7 @@ def create_whitelist(user, corpus): ...@@ -69,7 +69,7 @@ def create_whitelist(user, corpus):
return white_list return white_list
#def create_cooc(user, corpus, whitelist, blacklist, synonymes): #def create_cooc(user, corpus, whitelist, blacklist, synonymes):
def create_cooc(user=None, corpus=None, whitelist=None): def create_cooc(user=None, corpus=None, whitelist=None, size=200):
cursor = connection.cursor() cursor = connection.cursor()
try: try:
...@@ -127,8 +127,8 @@ def create_cooc(user=None, corpus=None, whitelist=None): ...@@ -127,8 +127,8 @@ def create_cooc(user=None, corpus=None, whitelist=None):
ORDER BY ORDER BY
score DESC score DESC
LIMIT LIMIT
150 %d
""" % (cooc.pk, corpus.id, whitelist.id, whitelist.id) """ % (cooc.pk, corpus.id, whitelist.id, whitelist.id, size)
cursor.execute(query_cooc) cursor.execute(query_cooc)
return cooc return cooc
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment