[Checkins] SVN: zopyx.versioning/trunk/zopyx/versioning/storages/mongodb/storage.py fixes (now we have to write the tests :-))

Andreas Jung andreas at andreas-jung.com
Fri Jul 2 03:25:36 EDT 2010


Log message for revision 114093:
  fixes (now we have to write the tests :-))
  

Changed:
  U   zopyx.versioning/trunk/zopyx/versioning/storages/mongodb/storage.py

-=-
Modified: zopyx.versioning/trunk/zopyx/versioning/storages/mongodb/storage.py
===================================================================
--- zopyx.versioning/trunk/zopyx/versioning/storages/mongodb/storage.py	2010-07-02 07:23:22 UTC (rev 114092)
+++ zopyx.versioning/trunk/zopyx/versioning/storages/mongodb/storage.py	2010-07-02 07:25:36 UTC (rev 114093)
@@ -65,12 +65,12 @@
     def list_revisions(self, id):
 
         revisions = self.revisions.find({'_oid' : id})
-        if revisons.count == 0:
+        if revisions.count == 0:
             raise errors.NoDocumentFound('No document with ID %s found' % id)
         return sorted([r['_rev'] for r in revisions])
 
     def remove_revision(self, id, revision):
-        self.revisions.delete({'_oid' : id, '_rev' : revision})
+        self.revisions.remove({'_oid' : id, '_rev' : revision})
 
 
 if __name__ == '__main__':
@@ -86,3 +86,6 @@
     print storage.has_revision('42', 42)
 
     print storage.list_revisions('42')
+    storage.remove_revision('42', 9)
+    print storage.store('42', version_data, 'ajung', 'versioning test')
+    print storage.list_revisions('42')



More information about the checkins mailing list