goa/gaesource.py
branchstable
changeset 2102 268659907769
parent 1977 606923dff11b
child 2476 1294a6bdf3bf
--- a/goa/gaesource.py	Thu Jun 11 19:07:47 2009 +0200
+++ b/goa/gaesource.py	Thu Jun 11 19:10:30 2009 +0200
@@ -47,7 +47,7 @@
                 asession.user.clear_related_cache(rtype, 'object')
 
 def _mark_modified(session, gaeentity):
-    modified = session.query_data('modifiedentities', {}, setdefault=True)
+    modified = session.transaction_data.setdefault('modifiedentities', {})
     modified[str(gaeentity.key())] = gaeentity
     DatastorePutOp(session)
 
@@ -98,8 +98,8 @@
         return 0
 
     def _put_entities(self):
-        pending = self.session.query_data('pendingeids', ())
-        modified = self.session.query_data('modifiedentities', {})
+        pending = self.session.transaction_data.get('pendingeids', ())
+        modified = self.session.transaction_data.get('modifiedentities', {})
         for eid, gaeentity in modified.iteritems():
             assert not eid in pending
             Put(gaeentity)
@@ -263,7 +263,7 @@
         Delete(key)
         session.clear_datastore_cache(key)
         session.drop_entity_cache(eid)
-        session.query_data('modifiedentities', {}).pop(eid, None)
+        session.transaction_data.get('modifiedentities', {}).pop(eid, None)
 
     def add_relation(self, session, subject, rtype, object):
         """add a relation to the source"""
@@ -275,7 +275,7 @@
     def delete_relation(self, session, subject, rtype, object):
         """delete a relation from the source"""
         gaesubj, gaeobj, cards = _rinfo(session, subject, rtype, object)
-        pending = session.query_data('pendingeids', set(), setdefault=True)
+        pending = session.transaction_data.setdefault('pendingeids', set())
         if not subject in pending:
             _rdel(session, gaesubj, gaeobj.key(), 's_' + rtype, cards[0])
         if not object in pending: