make history api return things in most-recent-message-first.
This commit is contained in:
Родитель
c42279960b
Коммит
13a65267c2
|
@ -19,7 +19,11 @@ class HistoryController(BaseController):
|
|||
def get(self):
|
||||
userkey = session['userkey']
|
||||
stmt = Session.query(Account.id).filter(Account.userkey==userkey).subquery()
|
||||
data = Session.query(History, Account.domain, Account.username).filter(Account.id == History.account_id).filter(History.account_id.in_(stmt)).all()
|
||||
data = Session.query(History, Account.domain, Account.username).filter(
|
||||
Account.id == History.account_id).\
|
||||
filter(History.account_id.in_(stmt)).\
|
||||
order_by(History.published.desc()).\
|
||||
all()
|
||||
res = []
|
||||
for h, d, u in data:
|
||||
r = h.to_dict()
|
||||
|
|
Загрузка…
Ссылка в новой задаче