Permalink
Browse files

Adding timesince to updates and comments

  • Loading branch information...
DFectuoso committed Apr 10, 2010
1 parent 4f170cf commit 23fce3f63c93a9b377c01a137be4f768c516c26d
Showing with 3 additions and 3 deletions.
  1. +3 −2 main.py
  2. +0 −1 templates/main.html
View
@@ -6,6 +6,7 @@
from google.appengine.ext.webapp import util, template
from google.appengine.api.labs import taskqueue
from django.utils import simplejson
+from django.template.defaultfilters import timesince
#CONSTANTS#
UPDATES_LIMIT = 10
@@ -71,14 +72,14 @@ def comment_dict(comment):
'id': str(comment.key().id()),
'user_fullname': comment.user_fullname(),
'body': comment.body,
- 'created': str(comment.created)}
+ 'ago': timesince(comment.created)}
def updates_dict(update):
return {
'id':str(update.key().id()),
'user_fullname':update.user_fullname(),
'body':update.body,
- 'created':str(update.created),
+ 'ago':timesince(update.created),
'comments':map(lambda c: comment_dict(c), update.comment_set) }
# Handlers:
View
@@ -49,7 +49,6 @@
function renderLoadMore(cursor){
return "<div id='load-more'><a href='javascript:loadMoreUpdates(\"" + cursor + "\")'>Load more...</a></div>";
-
}
function renderUpdate(update){

0 comments on commit 23fce3f

Please sign in to comment.