Request information about reddisc page for redfams
To generate links to related reddisc it is necessary to get at least the Title of the related reddisc page. As saving the same data in db is worse, we retreive it via join from red_pages table Related Task: [https://fs.golderweb.de/index.php?do=details&task_id=26 FS#26]
This commit is contained in:
@@ -353,10 +353,14 @@ article7 ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? );'
|
||||
|
||||
cursor = type( self ).connection.cursor( mysqldb.DictCursor )
|
||||
|
||||
cursor.execute(
|
||||
'SELECT * FROM `{prefix}_red_families` WHERE `status` = ? AND'.
|
||||
format(prefix=type( self ).db_table_prefix) +
|
||||
'`ending` >= ?;', ( status, ending ) )
|
||||
cursor.execute( (
|
||||
'SELECT * ' +
|
||||
'FROM `{prefix}_red_families` `F` ' +
|
||||
'INNER JOIN `{prefix}_red_pages` `P` ' +
|
||||
'ON `F`.`status` = ? ' +
|
||||
'AND `F`.`ending` >= ? '
|
||||
'AND `F`.`red_page_id` = `P`.`page_id`;').format(
|
||||
prefix=type( self ).db_table_prefix), ( status, ending ) )
|
||||
|
||||
while True:
|
||||
res = cursor.fetchmany( 1000 )
|
||||
|
||||
Reference in New Issue
Block a user