Nice code in Model of Django Python based framework
1 2 3 4 5 6 7 8 9 10 11 |
# In Django model def processed_description(self): text = self.description. \ replace('<table', '<div class="table">' '<div class="bgtop"></div>' '<div class="overflow"><table'). \ replace('</table>', '</table></div>' '<div class="bgbottom"></div>' '</div>'). \ replace('<th', '<th width="50%" align="left"') return text |