def get_star_html(cls, resource_id): report = reports.resource_five_stars(resource_id) stars = report.get('openness_score', -1) if stars >= 0: reason = report.get('openness_score_reason') return html.get_star_html(stars, reason) return None
def get_star_html(self, resource_id): from ckanext.qa import reports report = reports.resource_five_stars(resource_id) stars = report.get('openness_score', -1) if stars >= 0: reason = report.get('openness_score_reason') return html.get_star_html(stars, reason) return None