made compatable with python 2.5

This commit is contained in:
Laine
2012-08-02 15:30:21 -07:00
parent 91aa90ad4a
commit ed74477150
8 changed files with 94 additions and 40 deletions

View File

@@ -1267,8 +1267,8 @@ class SequenceField(IntField):
"""
Generate and Increment the counter
"""
sequence_id = "{0}.{1}".format(self.owner_document._get_collection_name(),
self.name)
sequence_id = "%s.%s"%(self.owner_document._get_collection_name(),
self.name)
collection = get_db(alias = self.db_alias )[self.collection_name]
counter = collection.find_and_modify(query={"_id": sequence_id},
update={"$inc": {"next": 1}},