aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaleb Forbes Davis V <caldavis@gmail.com>2011-07-04 20:24:57 -0500
committerCaleb Forbes Davis V <caldavis@gmail.com>2011-07-04 20:24:57 -0500
commit77b958018b8ef6343394b8f138e52944334a5e1c (patch)
treef4b0f703f31e8e6aa419f46a1ffd25c4125cc828
parent24df76fa1e4ee4902d882b8e75b5db981d27e08f (diff)
downloadmediagoblin-77b958018b8ef6343394b8f138e52944334a5e1c.tar.lz
mediagoblin-77b958018b8ef6343394b8f138e52944334a5e1c.tar.xz
mediagoblin-77b958018b8ef6343394b8f138e52944334a5e1c.zip
Feature #423 - gallery and scroll image ordering match
-rw-r--r--mediagoblin/db/models.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/mediagoblin/db/models.py b/mediagoblin/db/models.py
index 8aa35ca9..e764d368 100644
--- a/mediagoblin/db/models.py
+++ b/mediagoblin/db/models.py
@@ -147,9 +147,9 @@ class MediaEntry(Document):
"""
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' : {"$gt": self['_id']},
'uploader': self['uploader']}).sort(
- '_id', DESCENDING).limit(1)
+ '_id', ASCENDING).limit(1)
if cursor.count():
return urlgen('mediagoblin.user_pages.media_home',
@@ -160,9 +160,9 @@ class MediaEntry(Document):
"""
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' : {"$lt": self['_id']},
'uploader': self['uploader']}).sort(
- '_id', ASCENDING).limit(1)
+ '_id', DESCENDING).limit(1)
if cursor.count():
return urlgen('mediagoblin.user_pages.media_home',