Is it possible to filter over a DateTimeField to get all objects who have a DateTimeField later to the given date ? For instance :
class MyObject(models.Model):
updated_date = models.DateTimeField()
in a view :
given_date = someDateTime
new_items = MyObject.objects.filter(updated_date__after = given_date)
Use __gt
in a double underscore notation:
new_items = MyObject.objects.filter(updated_date__gt=given_date)
Relevant threads:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With