def default(self, o):
        if isinstance(o, Comment):
            for_json = dict([
                (name, getattr(o, name))
                for name in o.__dict__
                if isinstance(getattr(o, name), (basestring, int, list, dict))
            ])
            for_json['formatted_date'] = o.formatted_date()
            for_json['permalink'] = o.href()
            return for_json
        else:
            return json.JSONEncoder.default(self, o)