Using datetime to compare with dates in Django
I have a question in Django on how you can compare dates to solve some solutions. For example I have a datefield in my models.py Like below. class Invoice(models.Model): payment_date = models.DateTimeField() What I want to be able to do is ask if the is a way to compare a datetime.now with a DateTimeField. For example, if I had a list of payment dates and I wanted to compare with datetime now. Thhe payment_date's that are late with their payments are shown in owing. Otherwise, it the value is zero. Here is my views to show whats going on. I have tried so far but I get a 0 value for payment