def shortdate(self):
return self.date.strftime("%Y%m%d%H%M")
+ @property
+ def dateonly(self):
+ return self.date.strftime("%Y%m%d")
+
def from_name_only(self):
try:
return parseaddr(self.mailfrom)[0]
{%if messages%}
<h3>Browse Archives</h3>
{%with messages|first as firstmsg%}
-<a href="/list/{{list.listname}}/before/{{firstmsg.shortdate}}" rel="nofollow">Prev</a>
+<a href="/list/{{list.listname}}/before/{{firstmsg.dateonly}}0000" rel="nofollow">Prev</a>
{%endwith%}
|
{%with messages|last as lastmsg%}
-<a href="/list/{{list.listname}}/since/{{lastmsg.shortdate}}" rel="nofollow">Next</a>
+<a href="/list/{{list.listname}}/since/{{lastmsg.dateonly}}0000" rel="nofollow">Next</a>
{%endwith%}
{%endif%}
ensure_list_permissions(request, l)
try:
+ if int(hour) != 0 or int(minute) != 0:
+ # "round off" timestamps to the whole day, to reduce the number of unique urls
+ return HttpResponseRedirect("{}{}{}0000".format(year, month, day))
d = datetime(int(year), int(month), int(day), int(hour), int(minute))
except ValueError:
raise Http404("Invalid date format, not found")
ensure_list_permissions(request, l)
try:
+ if int(hour) != 0 or int(minute) != 0:
+ # "round off" timestamps to the whole day, to reduce the number of unique urls
+ return HttpResponseRedirect("{}{}{}0000".format(year, month, day))
d = datetime(int(year), int(month), int(day), int(hour), int(minute))
except ValueError:
raise Http404("Invalid date format, not found")