Returning modified data to a template
Posted
by Duncan
on Stack Overflow
See other posts from Stack Overflow
or by Duncan
Published on 2010-05-03T09:09:42Z
Indexed on
2010/05/03
9:18 UTC
Read the original article
Hit count: 218
I need to amend QuerySet data when i return it to a template.
for example, model.objects.all() returns a date (with other fields), but i also want to return the number of days since that date has passed. This is so that in the template, i can say "you last logged in 4 days ago".
What is the best way to do this?
© Stack Overflow or respective owner