aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/db/util.py
diff options
context:
space:
mode:
authorElrond <elrond+mediagoblin.org@samba-tng.org>2012-01-29 20:56:51 +0100
committerElrond <elrond+mediagoblin.org@samba-tng.org>2012-03-04 20:58:19 +0100
commit82cd968347988f61ac52c2100d1dc47750decead (patch)
tree7466d3b3b7d9ebda568c3ad4eeb8ed92d4215efb /mediagoblin/db/util.py
parentb8e635b22f9647b173b9320ebb6539bdefe851d8 (diff)
downloadmediagoblin-82cd968347988f61ac52c2100d1dc47750decead.tar.lz
mediagoblin-82cd968347988f61ac52c2100d1dc47750decead.tar.xz
mediagoblin-82cd968347988f61ac52c2100d1dc47750decead.zip
Create atomic_update db utility function
In some cases (notably the mark_entry_failed function) it is useful to have atomic update functionality on the db. On mongo this requires special syntax. So created an atomic_update function for mongo and started to use it in mark_entry_failed.
Diffstat (limited to 'mediagoblin/db/util.py')
-rw-r--r--mediagoblin/db/util.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/mediagoblin/db/util.py b/mediagoblin/db/util.py
index 1fc949a6..c48c4ba6 100644
--- a/mediagoblin/db/util.py
+++ b/mediagoblin/db/util.py
@@ -22,4 +22,5 @@ except ImportError:
if use_sql:
from mediagoblin.db.sql.fake import ObjectId, InvalidId, DESCENDING
else:
- from mediagoblin.db.mongo.util import ObjectId, InvalidId, DESCENDING
+ from mediagoblin.db.mongo.util import \
+ ObjectId, InvalidId, DESCENDING, atomic_update