Merge remote branch 'remotes/gullydwarf-cfdv/f435_limit_prev_next_by_processed'
This commit is contained in:
commit
d22a9ae86d
@ -148,7 +148,8 @@ class MediaEntry(Document):
|
|||||||
Provide a url to the previous entry from this user, if there is one
|
Provide a url to the previous entry from this user, if there is one
|
||||||
"""
|
"""
|
||||||
cursor = self.db.MediaEntry.find({'_id' : {"$lt": self['_id']},
|
cursor = self.db.MediaEntry.find({'_id' : {"$lt": self['_id']},
|
||||||
'uploader': self['uploader']}).sort(
|
'uploader': self['uploader'],
|
||||||
|
'state': 'processed'}).sort(
|
||||||
'_id', DESCENDING).limit(1)
|
'_id', DESCENDING).limit(1)
|
||||||
|
|
||||||
if cursor.count():
|
if cursor.count():
|
||||||
@ -161,7 +162,8 @@ class MediaEntry(Document):
|
|||||||
Provide a url to the next entry from this user, if there is one
|
Provide a url to the next entry from this user, if there is one
|
||||||
"""
|
"""
|
||||||
cursor = self.db.MediaEntry.find({'_id' : {"$gt": self['_id']},
|
cursor = self.db.MediaEntry.find({'_id' : {"$gt": self['_id']},
|
||||||
'uploader': self['uploader']}).sort(
|
'uploader': self['uploader'],
|
||||||
|
'state': 'processed'}).sort(
|
||||||
'_id', ASCENDING).limit(1)
|
'_id', ASCENDING).limit(1)
|
||||||
|
|
||||||
if cursor.count():
|
if cursor.count():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user