def migrate_schema_fields(self): # migrate the richtext super(CollectionMigrator, self).migrate_schema_fields() # migrate the rest of the schema into the behavior wrapped = ICollection(self.new) wrapped.query = self.old.query wrapped.sort_on = self.old.sort_on wrapped.sort_reversed = self.old.sort_reversed wrapped.limit = self.old.limit wrapped.customViewFields = self.old.customViewFields
def migrate_schema_fields(self): # migrate the richtext super(CollectionMigrator, self).migrate_schema_fields() # migrate the rest of the schema into the behavior wrapped = ICollection(self.new) wrapped.query = self.old.query wrapped.sort_on = self.old.sort_on wrapped.sort_reversed = self.old.sort_reversed wrapped.limit = self.old.limit wrapped.customViewFields = self.old.customViewFields
def migrate_criteria(self): """Migrate old style to new style criteria. Plus handling for some special fields. """ # The old Topic has boolean limitNumber and integer itemCount, # where the new Collection only has limit. adapted = ICollection(self.new) if self.old.getLimitNumber(): adapted.limit = self.old.getItemCount() adapted.customViewFields = self.old.getCustomViewFields() # Get the old data stored by the beforeChange_criteria method. if self._collection_sort_reversed is not None: adapted.sort_reversed = self._collection_sort_reversed if self._collection_sort_on is not None: adapted.sort_on = self._collection_sort_on if self._collection_query is not None: adapted.query = self._collection_query
def migrate_criteria(self): """Migrate old style to new style criteria. Plus handling for some special fields. """ # The old Topic has boolean limitNumber and integer itemCount, # where the new Collection only has limit. adapted = ICollection(self.new) if self.old.getLimitNumber(): adapted.limit = self.old.getItemCount() adapted.customViewFields = self.old.getCustomViewFields() # Get the old data stored by the beforeChange_criteria method. if self._collection_sort_reversed is not None: adapted.sort_reversed = self._collection_sort_reversed if self._collection_sort_on is not None: adapted.sort_on = self._collection_sort_on if self._collection_query is not None: adapted.query = self._collection_query