def get_rating_for_user(self): try: return Rating.objects.get(user=threadlocals.get_current_user(), version=self).score except: return 0
def user_is_maintainer(self): return threadlocals.get_current_user().pk == self.maintainer.pk or threadlocals.get_current_user().is_staff