34 lines
845 B
Python
34 lines
845 B
Python
# -*- encoding: utf-8 -*-
|
|
|
|
from django.contrib.syndication.views import Feed
|
|
from base.models import Item
|
|
|
|
class AoFeed(Feed):
|
|
title = "Appels d'offres pour EO"
|
|
link = "http://www.entrouvert.com/"
|
|
description = "Aggregation de flux RSS filtrés (relatifs à des AO)"
|
|
|
|
def items(self):
|
|
return Item.objects.order_by('-add_date')[:300]
|
|
|
|
def item_title(self, item):
|
|
title = '[' + item.source.__unicode__() + '] ' + item.title
|
|
if item.mark:
|
|
return '[!] ' + title
|
|
else:
|
|
return title
|
|
|
|
def item_description(self, item):
|
|
return item.description
|
|
|
|
def item_link(self, item):
|
|
return item.link
|
|
|
|
|
|
class AoFeedMark(AoFeed):
|
|
title = "Appels d'offres MARQUÉS"
|
|
|
|
def items(self):
|
|
return Item.objects.filter(mark=True).order_by('-add_date')[:300]
|
|
|