How do I filter a query to contain only the objects that have a date-time field that holds a DateTime in the future? Here is my code that is not working:
def matches(request):
matches= Match.objects.all().filter(match_date_time > timezone.now() )
context = {'matches': matches}
return render(request, 'bookie/matches.html', context)
match_date_time
is a model field in the Match
model but I get an error that it's not defined.