|
@@ -1,4 +1,6 @@
|
1
|
1
|
# -*- coding: utf-8 -*-
|
|
2
|
+from operator import itemgetter
|
|
3
|
+
|
2
|
4
|
__author__ = 'damien'
|
3
|
5
|
|
4
|
6
|
import datetime
|
|
@@ -556,8 +558,13 @@ class ContentApi(object):
|
556
|
558
|
.filter(~ContentRevisionRO.revision_id.in_(read_revision_ids)) \
|
557
|
559
|
.subquery()
|
558
|
560
|
|
559
|
|
- not_read_content_ids = DBSession.query(
|
560
|
|
- distinct(not_read_revisions.c.content_id)).all()
|
|
561
|
+ not_read_content_ids_query = DBSession.query(
|
|
562
|
+ distinct(not_read_revisions.c.content_id)
|
|
563
|
+ )
|
|
564
|
+ not_read_content_ids = list(map(
|
|
565
|
+ itemgetter(0),
|
|
566
|
+ not_read_content_ids_query,
|
|
567
|
+ ))
|
561
|
568
|
|
562
|
569
|
not_read_contents = self._base_query(workspace) \
|
563
|
570
|
.filter(Content.content_id.in_(not_read_content_ids)) \
|