Esempio n. 1
0
def calculate_datasets_five_star_rating(dataset_id):
    from ckanext.qa.reports import five_stars

    qa = five_stars(dataset_id)

    stars = 0
    for resource in qa:
        if resource['openness_score'] > stars:
            stars = resource['openness_score']

    return int(stars)
Esempio n. 2
0
 def five_stars(self):
     c.packages = five_stars()
     return render('ckanext/qa/dataset/five_stars/index.html')
Esempio n. 3
0
 def five_stars(self):
     c.packages = five_stars()
     return render("ckanext/qa/dataset/five_stars/index.html")
Esempio n. 4
0
 def dataset_five_stars(self, id=None):
     return json.dumps(five_stars(id))
Esempio n. 5
0
 def dataset_five_stars(self, id=None):
     result = five_stars(id)
     return self._output_json(result)
Esempio n. 6
0
 def five_stars(self):
     c.packages = five_stars()
     return p.toolkit.render('qa/five_stars.html')
Esempio n. 7
0
 def dataset_five_stars(self, id=None):
     result = five_stars(id)
     return self._output_json(result)
Esempio n. 8
0
 def five_stars(self):
     c.packages = five_stars()
     return p.toolkit.render('qa/five_stars.html')
Esempio n. 9
0
 def dataset_five_stars(self, id=None):
     return json.dumps(five_stars(id))