1👍
✅
Try this:
def save(self, *args, **kwargs):
if self.text != "":
results_dict = analyze(self.text)
for field_name in field_names_list:
setattr(self, field_name, results_dict[field_name])
super().save(*args, **kwargs)
Source:stackexchange.com