summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeif Johansson <leifj@sunet.se>2011-05-12 23:17:51 +0200
committerLeif Johansson <leifj@sunet.se>2011-05-12 23:17:51 +0200
commit525072bfd8c3781f2ced07f993caf94282995108 (patch)
treea4c71fb355afd8eb99afa3ac152e16e03b7a063f
parent89a6dc2ed00904fc2cb55c0663517236e04b9008 (diff)
need to reformat stuff - work from json representation for feeds
-rw-r--r--src/meetingtools/apps/room/views.py9
-rw-r--r--src/templates/apps/room/atom.xml8
-rw-r--r--src/templates/apps/room/rss2.xml3
3 files changed, 10 insertions, 10 deletions
diff --git a/src/meetingtools/apps/room/views.py b/src/meetingtools/apps/room/views.py
index 2925853..c5fc8b8 100644
--- a/src/meetingtools/apps/room/views.py
+++ b/src/meetingtools/apps/room/views.py
@@ -25,6 +25,7 @@ from django_co_acls.models import allow, deny, acl, clear_acl
from meetingtools.ac.api import ACPClient
from tagging.models import Tag, TaggedItem
import random, string
+from django.utils.feedgenerator import rfc3339_date
def _acc_for_user(user):
(local,domain) = user.username.split('@')
@@ -383,7 +384,7 @@ def _room2dict(room):
return {'name':room.name,
'description':room.description,
'user_count':room.user_count,
- 'lastupdated': timeAsrfc822(room.lastupdated),
+ 'updated': rfc3339_date(room.lastupdated),
'self_cleaning': room.self_cleaning,
'url': room.go_url()}
@@ -398,21 +399,21 @@ def widget(request,tn):
'application/json': json_response([_room2dict(room) for room in rooms]),
'application/rss+xml': 'apps/room/rss2.xml',
'text/rss': 'apps/room/rss2.xml'},
- {'title':title,'description':title ,'edit':False,'date': now,'tags': tn,'rooms':rooms.all()})
+ {'title':title,'description':title ,'edit':False,'date': now,'tags': tn,'rooms': [_room2dict(room) for room in rooms.all()]})
# should not require login
def list_by_tag(request,tn):
tags = tn.split('+')
rooms = TaggedItem.objects.get_by_model(Room, tags)
title = 'Rooms tagged with %s' % " and ".join(tags)
- now = timeAsrfc822( datetime.now())
+ now = rfc3339_date(datetime.now())
return respond_to(request,
{'text/html':'apps/room/list.html',
'application/json': json_response([_room2dict(room) for room in rooms]),
'application/atom+xml': 'apps/room/atom.xml',
'application/rss+xml': 'apps/room/rss2.xml',
'text/rss': 'apps/room/rss2.xml'},
- {'title':title,'description':title ,'edit':False,'baseurl': BASE_URL,'date': now,'tags': tn,'rooms':rooms.all()})
+ {'title':title,'description':title ,'edit':False,'baseurl': BASE_URL,'date': now,'tags': tn,'rooms':[_room2dict(room) for room in rooms.all()]})
def _can_tag(request,tag):
if tag in ('selfcleaning','public','private'):
diff --git a/src/templates/apps/room/atom.xml b/src/templates/apps/room/atom.xml
index eab8dc7..15b329c 100644
--- a/src/templates/apps/room/atom.xml
+++ b/src/templates/apps/room/atom.xml
@@ -7,14 +7,14 @@
<link href="{{baseurl}}/room/+{{tags}}"/>
{% if rooms %}
{% for room in rooms %}
- <item>
+ <entry>
<title>{{room.name}}</title>
{% if room.description %}
<summary>{{room.description}}</summary>
{% endif %}
- <link href="{{room.go_url}}"/>
- <updated>{{room.lastupdated}}</updated>
- </item>
+ <link href="{{room.url}}"/>
+ <updated>{{room.updated}}</updated>
+ </entry>
{% endfor %}
{% endif %}
</feed> \ No newline at end of file
diff --git a/src/templates/apps/room/rss2.xml b/src/templates/apps/room/rss2.xml
index 16a420c..5a30d58 100644
--- a/src/templates/apps/room/rss2.xml
+++ b/src/templates/apps/room/rss2.xml
@@ -18,8 +18,7 @@
{% if room.description %}
<description>{{room.description}}</description>
{% endif %}
- <link>{{room.go_url}}</link>
- <guid isPermaLink="true">{{room.go_url_internal}}</guid>
+ <link>{{room.url}}</link>
</item>
{% endfor %}
{% endif %}