I've got a date_created field in my database:
date_created = models.DateField(auto_now_add=True)
Is there some way I could filter date_created by weekend/weekday? I know that python's date.weekday() returns 0 - 6 depending on days of the week, so I'd like to use something like:
apps.objects.filter(date_created__weekday >=5) // filter by weekend
Django comes with a weekday field lookup.
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