- def __get__(self, move, move_class):
- effect_text = getattr(move.move_effect, self.effect_column)
- effect_text = effect_text.replace(
- u'$effect_chance',
- unicode(move.effect_chance),
- )
-
- return MarkdownString(effect_text)
+ def __get__(self, obj, cls):
+ prop = getattr(obj.move_effect, self.effect_column)
+ if isinstance(prop, dict):
+ # Looks like a dict proxy; markdownify everyone
+ newdict = dict(prop)
+ for key in newdict:
+ newdict[key] = _markdownify_effect_text(obj, newdict[key])
+ return newdict
+
+ # Otherwise, scalar prop. Boring
+ return _markdownify_effect_text(obj, prop)