1👍
✅
Perhaps something like this:
from datetime import datetime
now = datetime.today()
Appointment.objects.filter(date__gte=now)
0👍
You can work with the timestamp of the database with a Now
expression [Django-doc]:
from django.db.models.functions import Now
Appointment.objects.filter(date__gte=Now())
- [Answered ]-Django & custom auth backend (web service) + no database. How to save stuff in session?
- [Answered ]-How to delete many to many when unassociated in Django?
Source:stackexchange.com