diff options
author | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2011-11-21 20:18:38 +0100 |
---|---|---|
committer | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2011-12-05 21:08:58 +0100 |
commit | 1ceb4fc8682dd00c15376b75a3d9222cac6fb5bd (patch) | |
tree | 3cf7c61be2d5367775229bf6bc5bde47ee98b937 /mediagoblin/db/models.py | |
parent | 0547843020643febbdcbfa33377fd48f92c568c8 (diff) | |
download | mediagoblin-1ceb4fc8682dd00c15376b75a3d9222cac6fb5bd.tar.lz mediagoblin-1ceb4fc8682dd00c15376b75a3d9222cac6fb5bd.tar.xz mediagoblin-1ceb4fc8682dd00c15376b75a3d9222cac6fb5bd.zip |
Dot-Notation for MediaEntry.uploader
Diffstat (limited to 'mediagoblin/db/models.py')
-rw-r--r-- | mediagoblin/db/models.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mediagoblin/db/models.py b/mediagoblin/db/models.py index 795cba6a..f1f56dd1 100644 --- a/mediagoblin/db/models.py +++ b/mediagoblin/db/models.py @@ -281,7 +281,7 @@ class MediaEntry(Document): Provide a url to the previous entry from this user, if there is one """ cursor = self.db.MediaEntry.find({'_id': {"$gt": self._id}, - 'uploader': self['uploader'], + 'uploader': self.uploader, 'state': 'processed'}).sort( '_id', ASCENDING).limit(1) if cursor.count(): @@ -294,7 +294,7 @@ class MediaEntry(Document): Provide a url to the next entry from this user, if there is one """ cursor = self.db.MediaEntry.find({'_id': {"$lt": self._id}, - 'uploader': self['uploader'], + 'uploader': self.uploader, 'state': 'processed'}).sort( '_id', DESCENDING).limit(1) @@ -304,7 +304,7 @@ class MediaEntry(Document): media=unicode(cursor[0]['slug'])) def get_uploader(self): - return self.db.User.find_one({'_id': self['uploader']}) + return self.db.User.find_one({'_id': self.uploader}) def get_fail_exception(self): """ |