mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-30 10:26:58 +01:00
fix to work with devids and devtypes being arrays
This commit is contained in:
parent
9169659c80
commit
e12069b45d
1 changed files with 2 additions and 2 deletions
|
@ -57,7 +57,7 @@ def init():
|
|||
def getPendingMsgs( con, typ ):
|
||||
cur = con.cursor()
|
||||
query = """SELECT %s FROM msgs
|
||||
WHERE devid IN (SELECT id FROM devices WHERE devtype=%d and NOT unreg)
|
||||
WHERE devid IN (SELECT id FROM devices WHERE devtypes[1]=%d and NOT unreg)
|
||||
AND NOT connname IN (SELECT connname FROM games WHERE dead); """
|
||||
cur.execute(query % (",".join( g_columns ), typ))
|
||||
|
||||
|
@ -104,7 +104,7 @@ def unregister( gcmid ):
|
|||
|
||||
def asGCMIds(con, devids, typ):
|
||||
cur = con.cursor()
|
||||
query = "SELECT devid FROM devices WHERE devtype = %d AND id IN (%s)" \
|
||||
query = "SELECT devids[1] FROM devices WHERE devtypes[1] = %d AND id IN (%s)" \
|
||||
% (typ, ",".join([str(y) for y in devids]))
|
||||
cur.execute( query )
|
||||
return [elem[0] for elem in cur.fetchall()]
|
||||
|
|
Loading…
Reference in a new issue