Révision 2a14e3e1
Ajouté par Serghei Mihai il y a plus de 7 ans
corbo/views.py | ||
---|---|---|
1 |
from datetime import datetime |
|
2 | 1 |
import urllib |
3 | 2 |
import json |
4 | 3 |
|
5 | 4 |
from django.conf import settings |
6 | 5 |
from django.core import signing |
6 |
from django.utils import timezone |
|
7 | 7 |
from django.core.urlresolvers import reverse |
8 | 8 |
from django.views.generic import CreateView, UpdateView, DeleteView, \ |
9 | 9 |
ListView, TemplateView, RedirectView, DetailView |
... | ... | |
202 | 202 |
self.__dict__.update(kwargs) |
203 | 203 |
|
204 | 204 |
def items(self): |
205 |
return models.Announce.objects.exclude(expiration_time__lt=datetime.now()).order_by('-publication_time') |
|
205 |
return models.Announce.objects.filter(publication_time__lte=timezone.now()).exclude( |
|
206 |
expiration_time__lt=timezone.now()).order_by('-publication_time') |
|
206 | 207 |
|
207 | 208 |
def item_title(self, item): |
208 | 209 |
return item.title |
Formats disponibles : Unified diff
rss: expose published announces only (#14731)