Posts tagged ‘django’

Human readable datetimes in python’s django

For the benefit of google (and me when I’m searching). To create human readable dates, datetimes and timestamps in django’s templating language one can use the timesince filter like so

This happened {{ object.creation_date|timesince }} ago

March 11, 2010 at 9:11 pm Leave a comment

Multiple recursive many-to-many relationships in djangos ORM

These don’t work – who knew. At least I think this the case

The problem is that the link-backs are constructive from the class name (and can’t be overridden) – so if you has a recursive many link for Majig to itself then an instance of majig has a majig_set attribute for the link-backs. But what happens when you have two such relations.

February 19, 2010 at 11:58 pm Leave a comment


August 2017
M T W T F S S
« Nov    
 123456
78910111213
14151617181920
21222324252627
28293031