Skip to content
Snippets Groups Projects
Commit 5f6915a9 authored by Brian Moe's avatar Brian Moe
Browse files

Added author/pubdate/time info to RSS data

Time info includes event time and creation time
in both UTC and GPS time formats, plus reporting
latency.
parent e2e6c235
No related branches found
No related tags found
No related merge requests found
......@@ -53,6 +53,12 @@ class EventFeed(Feed):
def item_link(self, obj):
return reverse(view, args=[obj.graceid()])
def item_author_name(self, obj):
return obj.submitter.name
def item_pubdate(self, obj):
return obj.created
def description(self, obj):
# XXX Descriptive text for the feed itself.
# I don't know what to put here
......
......@@ -115,6 +115,13 @@ def utc(dt, format=FORMAT):
def gpsdate(gpstime, format=FORMAT):
return dateformat.format(gpsToUtc(gpstime), format)
@register.filter
def gpstime(dt):
if not dt.tzinfo:
dt = SERVER_TZ.localize(dt)
posix_time = time.mktime(dt.timetuple())
gps_time = int(posixToGpsTime(posix_time))
return gps_time
def timeSelections(t):
rv = {}
......
{% load timeutil %}
<table>
<tr><td>Created:</td>
<td>{{ obj.created|utc }}</td>
<td>{{ obj.created|gpstime }}</td>
</tr>
{% if obj.gpstime %}
<tr><td>Event Time:</td>
<td>{{ obj.gpstime|gpsdate }}</td>
<td>{{ obj.gpstime }}</td>
</tr>
<tr><td>Reporting Latency:</td>
<td colspan="w">{{ obj.reportingLatency }} seconds</td></tr>
{% endif %}
</table>
<ul>
<li><a href="{{ obj.weburl }}">Data</a></li>
<li><a href="{{ obj.wikiurl }}">TWiki</a></li>
</ul>
Sumbmitter: {{ obj.submitter.name }}<br/>
Created: {{ obj.created|utc }}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment