Exemplo n.º 1
0
 def _convertToMongo(self, entity):
     if entity.entity_id is not None and entity.entity_id.startswith('T_'):
         del entity.entity_id
     document = AMongoCollection._convertToMongo(self, entity)
     if document is None:
         return None
     if 'title' in document:
         document['titlel'] = getSimplifiedTitle(document['title'])
     return document
Exemplo n.º 2
0
    def _convertToMongo(self, account):
        document = AMongoCollection._convertToMongo(self, account)
        
        if 'screen_name' in document:
            document['screen_name_lower'] = str(document['screen_name']).lower()
        if 'name' in document and document['name'] is not None:
            document['name_lower'] = unicode(document['name']).lower()
        if 'phone' in document and document['phone'] is not None:
            document['phone'] = str(document['phone'])

        return document
Exemplo n.º 3
0
    def _convertToMongo(self, entity):
        if entity.entity_id is not None and entity.entity_id.startswith('T_'):
            del entity.entity_id

        # Extract search tokens
        searchTokens = generateSearchTokens(entity)

        # Convert document
        document = AMongoCollection._convertToMongo(self, entity)
        if document is None:
            return None

        # Add search tokens
        document['search_tokens'] = searchTokens

        # Add titlel
        if 'title' in document:
            document['titlel'] = getSimplifiedTitle(document['title'])

        return document