diff options
-rw-r--r-- | docs/hackinghowto.rst | 5 | ||||
-rw-r--r-- | mediagoblin/db/models.py | 10 |
2 files changed, 11 insertions, 4 deletions
diff --git a/docs/hackinghowto.rst b/docs/hackinghowto.rst index 08b228f1..914a5135 100644 --- a/docs/hackinghowto.rst +++ b/docs/hackinghowto.rst @@ -57,6 +57,11 @@ requirements:: sudo apt-get install mongodb git-core python python-dev \ python-lxml +On Fedora:: + + yum install mongodb-server python-paste-deploy python-paste-script \ + git-core python python-devel + .. YouCanHelp:: If you have instructions for other GNU/Linux distributions to set diff --git a/mediagoblin/db/models.py b/mediagoblin/db/models.py index 8aa35ca9..37839a00 100644 --- a/mediagoblin/db/models.py +++ b/mediagoblin/db/models.py @@ -148,26 +148,28 @@ 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']}, - 'uploader': self['uploader']}).sort( + 'uploader': self['uploader'], + 'state': 'processed'}).sort( '_id', DESCENDING).limit(1) if cursor.count(): return urlgen('mediagoblin.user_pages.media_home', user=self.uploader()['username'], - media=unicode(cursor[0]['_id'])) + media=unicode(cursor[0]['slug'])) def url_to_next(self, urlgen): """ Provide a url to the next entry from this user, if there is one """ cursor = self.db.MediaEntry.find({'_id' : {"$gt": self['_id']}, - 'uploader': self['uploader']}).sort( + 'uploader': self['uploader'], + 'state': 'processed'}).sort( '_id', ASCENDING).limit(1) if cursor.count(): return urlgen('mediagoblin.user_pages.media_home', user=self.uploader()['username'], - media=unicode(cursor[0]['_id'])) + media=unicode(cursor[0]['slug'])) def uploader(self): return self.db.User.find_one({'_id': self['uploader']}) |