This should actually fix the next and previous buttons now. Sorry I borked the merge!
authorChristopher Allan Webber <cwebber@dustycloud.org>
Thu, 7 Jul 2011 13:22:12 +0000 (08:22 -0500)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Thu, 7 Jul 2011 13:22:12 +0000 (08:22 -0500)
mediagoblin/db/models.py

index 2b7933a4db324b60e1aa6cfddc54d3fa234dcdf9..279cb9f2bfe5c286698eb38307badec9dd012ebc 100644 (file)
@@ -147,7 +147,7 @@ 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'],
                                           'state': 'processed'}).sort(
                                                     '_id', ASCENDING).limit(1)
@@ -160,7 +160,7 @@ 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'],
                                           'state': 'processed'}).sort(
                                                     '_id', DESCENDING).limit(1)