How to Auto update the status when the medicine is expired? for example, I created medicine record and set the expirationdate to july 2022, if the current date is greater than the expirationdate it will update the status of medicine to "Expired", How do I do that?
class Medicine(models.Model):
medstatus = [
("Expired", "Expired"),
("Active", "Active")
]
description = models.CharField(max_length=50, null=True)
expirationDate = models.DateField(null=True)
status = models.CharField(max_length=50, choices=medstatus, null=True)