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
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.