Skip to content
Snippets Groups Projects
Commit de231ccbbcf3 authored by Katia Saurfelt's avatar Katia Saurfelt
Browse files

[refactoring] split IFullTextIndexSerializable.serialize method to ease overriding

parent 7859ebfada15
No related branches found
No related tags found
No related merge requests found
......@@ -109,6 +109,12 @@
attrs.extend(self.custom_indexable_attributes)
return attrs
def process_attributes(self):
data = {}
for attr in self.fulltext_indexable_attributes:
data[attr] = getattr(self.entity, attr)
return data
def serialize(self, complete=True):
entity = self.entity
if complete:
......@@ -118,6 +124,4 @@
'eid': entity.eid,
'cwuri': entity.cwuri,
}
for attr in self.fulltext_indexable_attributes:
data[attr] = getattr(entity, attr)
# TODO take a look at what's in entity.cw_relation_cache
......@@ -123,4 +127,5 @@
# TODO take a look at what's in entity.cw_relation_cache
data.update(self.process_attributes())
return data
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment