From eab8a83da61dba21f7453c82ccad6cebec1c3add Mon Sep 17 00:00:00 2001 From: bsimpson63 Date: Mon, 16 Apr 2012 17:00:52 -0700 Subject: [PATCH] Add _on_commit hook for tdb_cassandra.ThingBase. --- r2/r2/lib/db/tdb_cassandra.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/r2/r2/lib/db/tdb_cassandra.py b/r2/r2/lib/db/tdb_cassandra.py index cd88e0ecc..20f68917b 100644 --- a/r2/r2/lib/db/tdb_cassandra.py +++ b/r2/r2/lib/db/tdb_cassandra.py @@ -629,6 +629,8 @@ class ThingBase(object): if not self._committed: self._on_create() + else: + self._on_commit() self._committed = True @@ -744,6 +746,10 @@ class ThingBase(object): well""" pass + def _on_commit(self): + """Executed on _commit other than creation.""" + pass + @classmethod def _all(cls): # returns a query object yielding every single item in a