I am working on a website in Django and I have a model 'Question'. The Question model has a field 'date_created' which is a DateTimeField.
from django.db import models
from django.utils import timezone
class Question(models.Model:
...
date_created = models.DateTimeField(default=timezone.now)
In my view, I want to be able to get all the questions that have been asked in the last 10 days. Something like this:
Question.objects.filter(???)
>> <All the questions that have been asked in the last 10 days>
What do I replace '???' with? Thanks in advance.