def builder_wrapper(thing): if isinstance(thing, Comment): f = thing._fullname w = Wrapped(thing) w.render_class = Message w.to_id = c.user._id w.was_comment = True w._fullname = f else: w = ListingController.builder_wrapper(thing) return w