I have a Django model as follows that includes version_date, which is a DateTimeField:
class Flow(models.Model):
name = models.CharField(max_length=30, choices=FLOW_NAMES)
version = models.PositiveSmallIntegerField()
version_date = models.DateTimeField()
file = models.FileField(blank=True,null=True)
last_accessed = models.DateTimeField(auto_now=True)
I would like to compare a timestamp which I have extracted from a XML file, to each version_date value stored in the model. How can I iterate through the model comparing the extracted timestamp to each version_date in the model?