Store directly percent

This commit is contained in:
Michal Čihař 2012-02-28 10:27:59 +01:00
parent 3936780671
commit 54a48dfe88

View File

@ -204,8 +204,8 @@ class Translation(models.Model):
total = self.unit_set.count()
fuzzy = self.unit_set.filter(fuzzy = True).count()
translated = self.unit_set.filter(translated = True).count()
self.fuzzy = fuzzy * 1.0 / total
self.translated = translated * 1.0 / total
self.fuzzy = round(fuzzy * 100.0 / total, 1)
self.translated = round(translated * 100.0 / total, 1)
self.revision = blob.hexsha
self.save()