Re: Creating a list off a model based on time delta

2014-07-20 Thread Tomas Ehrlich
Use __gte lookup: latest_articles_list = Article.objects.filter(pub_date__gte=thirty_days_ago) and take a look at other lookups: https://docs.djangoproject.com/en/1.6/ref/models/querysets/#field-lookups Cheers, Tom Dne Sun, 20 Jul 2014 20:50:53 -0700 (PDT) Conner DiPaolo napsal(a): > I've b

Re: Creating a list off a model based on time delta

2014-07-20 Thread Conner DiPaolo
I've been thinking about it and I think this should work but it doesn't. latest_articles_list = Article.objects.filter(pub_date>=thirty_days_ago) Django is saying 'pub_date' is not defined, even though I used it to filter a different list and it worked fine. What is wrong?? Thanks On Sunday, J

Creating a list off a model based on time delta

2014-07-20 Thread Conner DiPaolo
Hi! I was wondering if anybody knew how to create a list based on that list having a DateTime attribute that is less than 30 days old. I already have a boolean in the model itself of 'published_recent_month' that can say if it is or is not published within a month, but how do I put into that a l