Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 30th, 2012  |  syntax: None  |  size: 0.31 KB  |  hits: 7  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Why is this template function call not working?
  2. class DealInstance(models.Model):
  3.     start = models.DateTimeField()
  4.     end = models.DateTimeField()
  5.  
  6.     def get_remaining_time(self):
  7.         return end - start # returns a datetime.timedelta object
  8.        
  9. <p>Time diff: {{ deal_instance.get_remaining_time.days }}</p>