summaryrefslogtreecommitdiff
path: root/postgresqleu/confreg/feeds.py
diff options
context:
space:
mode:
authorMagnus Hagander2020-03-25 17:07:16 +0000
committerMagnus Hagander2020-03-25 17:48:07 +0000
commit24c235de23f8ef34ecffb1b4ebd44c088fabc989 (patch)
treeb2d2c2667b3373aee64aa306239872747948b4a1 /postgresqleu/confreg/feeds.py
parentc2257566b9463828eabcbbd915335f301981d850 (diff)
Implement native pages for conference news articles
This means each conference news now gets a proper permanent link going to /events/<conference>/news/<slug>-<id>/, and this is the link that's put out in the RSS feeds. A page is created at /events/<conference>/news/ which contains the full news history for the conference. This creates a new "section" in the templates called "news", for those skins that care about the section. Fixes #44
Diffstat (limited to 'postgresqleu/confreg/feeds.py')
-rw-r--r--postgresqleu/confreg/feeds.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/postgresqleu/confreg/feeds.py b/postgresqleu/confreg/feeds.py
index 053c7f18..1f4ed70d 100644
--- a/postgresqleu/confreg/feeds.py
+++ b/postgresqleu/confreg/feeds.py
@@ -39,7 +39,7 @@ class ConferenceNewsFeed(Feed):
return obj.confurl
def items(self, obj):
- return exec_to_dict("""SELECT n.id, c.confurl AS link, datetime, c.conferencename || ' - ' || title AS title, summary
+ return exec_to_dict("""SELECT n.id, c.urlname, datetime, c.conferencename || ' - ' || title AS title, summary
FROM confreg_conferencenews n
INNER JOIN confreg_conference c ON c.id=conference_id
WHERE datetime<CURRENT_TIMESTAMP AND inrss AND conference_id=%(cid)s
@@ -51,7 +51,12 @@ ORDER BY datetime DESC LIMIT 10""", {
return news['title']
def item_link(self, news):
- return '{0}##{1}'.format(news['link'], news['id'])
+ return '{0}/events/{1}/news/{2}-{3}/'.format(
+ settings.SITEBASE,
+ news['urlname'],
+ slugify(news['title']),
+ news['id'],
+ )
def item_pubdate(self, news):
return news['datetime']