Hello, A possible solution is create a specific method in your model class to do this calculation. Take a look at: https://docs.djangoproject.com/en/1.3/topics/db/models/#model-methods
If you only want to do this calculations to show it in templates you may consider creating a specific template custom tag/filters. Regards, On Sat, Oct 22, 2011 at 1:31 AM, dr.phil <dr.p...@allergyct.com> wrote: > Is this possible? I have a model that includes a datetime field. When > creating a queryset of this model, I want to include a calculated > field of the time difference (in hours:minutes compared to > datetime.now). > > Currently, when creating a queryset the datetime is included. I can > iterate through the queryset to calculate the time difference and > replace the value. HOWEVER, when I act on this queryset, the original > (with datetime oject) is used, not the new dictionary I created. > > Help is apppreciated. > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- Pedro Vasconcelos 85 8767.1843 ptronico (skype) -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.