Something like this would work for you:
from datetime import datetime, timedelta
how_many_days = 30
MyObject.objects.filter(entered__lte=datetime.now()-timedelta(days=how_many_days))
More Related Contents:
- (13: Permission denied) while connecting to upstream:[nginx]
- Django Cookies, how can I set them?
- Issue with ManyToMany Relationships not updating immediately after save
- Django: Populate user ID when saving a model
- How to revert the last migration?
- Manager isn’t available; User has been swapped for ‘pet.Person’
- Custom QuerySet and Manager without breaking DRY?
- Django: Query using contains each value in a list
- Changing Django settings at runtime
- How do you serialize a model instance in Django?
- How to make email field unique in model User from contrib.auth in Django
- Workflow frameworks for Django [closed]
- Django ModelForm override widget
- What is the right way to use angular2 http requests with Django CSRF protection?
- Django Push HTTP Response to users [closed]
- django admin login suddenly demanding csrf token
- Django – Cascade deletion in ManyToManyRelation
- How to cURL an Authenticated Django App?
- Django admin: How to display a field that is marked as editable=False’ in the model?
- django unit tests without a db
- ImportError: No module named ‘_sqlite3’ in python3.3
- Django admin DoesNotExist at /admin/
- Pass request context to serializer from Viewset in Django Rest Framework
- UnicodeEncodeError: ‘ascii’ codec can’t encode character
- How can I upload and download files with graphene-django?
- Django give Error 500 for all static files like CSS and Images, when DEBUG is False
- Django, query filtering from model method
- Parsing a Datetime String into a Django DateTimeField
- How can I test binary file uploading with django-rest-framework’s test client?
- Django – [Errno 111] Connection refused