コード例 #1
0
 def ensure_utf_8_keywords(self):
     for obj in self.objects(self.query, 'Ensure keywords are utf-8'):
         doc = IDocumentMetadata(obj)
         doc.keywords = tuple(
             safe_unicode(keyword).encode('utf-8')
             for keyword in doc.keywords)
コード例 #2
0
 def make_document_keywords_unicode(self):
     query = {'object_provides': [IDocumentMetadata.__identifier__]}
     for obj in self.objects(query, 'Ensure document keywords are unicode'):
         doc = IDocumentMetadata(obj)
         doc.keywords = tuple(
             safe_unicode(keyword) for keyword in doc.keywords)
コード例 #3
0
ファイル: upgrade.py プロジェクト: 4teamwork/opengever.core
 def make_document_keywords_unicode(self):
     query = {'object_provides': [IDocumentMetadata.__identifier__]}
     for obj in self.objects(query, 'Ensure document keywords are unicode'):
         doc = IDocumentMetadata(obj)
         doc.keywords = tuple(
             safe_unicode(keyword) for keyword in doc.keywords)