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
Advertisements

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


October 2018
M T W T F S S
« Nov    
1234567
891011121314
15161718192021
22232425262728
293031