Re: Finding Duration: Creating a context variable from two DateField model fields

2010-08-05 Thread Paulo Almeida
A function or property in the model would do nicely. You can check this page for more information: http://www.b-list.org/weblog/2006/aug/18/django-tips-using-properties-models-and-managers/ - Paulo On Fri

Finding Duration: Creating a context variable from two DateField model fields

2010-08-05 Thread flowpoke
I have a simple model that includes two DateField fields. I have everything passing to the template, as I would like but i'd like to add one more variable, duration. I want {{ duration }} to be that of the delta between the two DateField fields, in years. It's simple arithmetic but im not sure wher