def update_review(self, review): try: r = int(review) if choice_name(settings.REVIEW_CHOICES, r) != "unknown": self.review = r self.save() return True except ValueError: pass return False
def tokenizer_name(self): return choice_name(settings.TOKENIZER_CHOICES, self.tokenizer)
def provider_name(self): return choice_name(settings.PROVIDER_CHOICES, self.provider)
def review_name(self): return choice_name(settings.REVIEW_CHOICES, self.review)