diff options
author | Leif Johansson <leifj@sunet.se> | 2011-05-13 23:31:52 +0200 |
---|---|---|
committer | Leif Johansson <leifj@sunet.se> | 2011-05-13 23:31:52 +0200 |
commit | 22bc00a3c040bc06f9149eb99573dc8a1114aabd (patch) | |
tree | fd23e6aa45741279d460a21c7d0188abcb6a08bc /src/meetingtools/apps | |
parent | 678b54d910c0022ea4ba9360ef9a5ba11d7e18a7 (diff) |
add recordings and some minor cleanup
Diffstat (limited to 'src/meetingtools/apps')
-rw-r--r-- | src/meetingtools/apps/cluster/models.py | 5 | ||||
-rw-r--r-- | src/meetingtools/apps/room/views.py | 25 |
2 files changed, 28 insertions, 2 deletions
diff --git a/src/meetingtools/apps/cluster/models.py b/src/meetingtools/apps/cluster/models.py index 7dba80e..9921dd4 100644 --- a/src/meetingtools/apps/cluster/models.py +++ b/src/meetingtools/apps/cluster/models.py @@ -16,4 +16,7 @@ class ACCluster(models.Model): domain_match = TextField() def __unicode__(self): - return self.url
\ No newline at end of file + return self.url + + def make_url(self,path=""): + return "%s%s" % (self.url,path)
\ No newline at end of file diff --git a/src/meetingtools/apps/room/views.py b/src/meetingtools/apps/room/views.py index 97a487c..b0297cd 100644 --- a/src/meetingtools/apps/room/views.py +++ b/src/meetingtools/apps/room/views.py @@ -440,4 +440,27 @@ def tag(request,rid): else: form = TagRoomForm() - return respond_to(request, {'text/html': "apps/room/tag.html"}, {'form': form,'formtitle': 'Add Tag','cancelname':'Done','submitname': 'Add Tag','room': room, 'tags': Tag.objects.get_for_object(room)})
\ No newline at end of file + return respond_to(request, + {'text/html': "apps/room/tag.html"}, + {'form': form,'formtitle': 'Add Tag','cancelname':'Done','submitname': 'Add Tag','room': room, 'tags': Tag.objects.get_for_object(room)}) + + +from time import mktime +from feedparser import _parse_date as parse_date + +@login_required +def recordings(request,rid): + room = get_object_or_404(Room,pk=rid) + api = ac_api_client(request, room.acc) + + r = api.request('sco-expanded-contents',{'sco-id': room.sco_id,'filter-icon':'archive'},True) + recordings = [{'name': sco.findtext('name'), + 'sco_id': sco.get('sco-id'), + 'url': room.acc.make_url(sco.findtext('url-path')), + 'description': sco.findtext('description'), + 'date_created': datetime.fromtimestamp(mktime(parse_date(sco.findtext('date-created')))), + 'date_modified': datetime.fromtimestamp(mktime(parse_date(sco.findtext('date-modified'))))} for sco in r.et.findall(".//sco")] + + return respond_to(request, + {'text/html': 'apps/room/recordings.html'}, + {'recordings': recordings,'room':room})
\ No newline at end of file |