Merge branch 'master' into design
[mygpo.git] / mygpo / core / oldid.py
blobf33360f11c744bc4279ab1a39577e24672a470e8
1 from couchdbkit.ext.django.schema import *
4 class OldIdMixin(DocumentSchema):
5 """ Objects that have an Old-Id from the old MySQL backend """
7 oldid = IntegerProperty()
8 merged_oldids = ListProperty()
11 def set_oldid(self, oldid):
12 if self.oldid:
13 self.add_merged_oldid(self.oldid)
14 self.oldid = oldid
17 def add_merged_oldid(self, oldid):
18 if oldid not in self.merged_oldids:
19 self.merged_oldids.append(oldid)