| Subject: | Re: [zimpy] Best way to store year only 'YYYY' dates |
|---|---|
| Date: | Mon, 30 Nov 2015 18:56:46 +0200 |
| From: | Humphrey <hbut...@gmail.com> |
| To: | rayjowa <ray...@gmail.com> |
--
You received this message because you are subscribed to the Google Groups "Zimbabwe Python Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zimpy+un...@googlegroups.com.
Visit this group at http://groups.google.com/group/zimpy.
To view this discussion on the web, visit https://groups.google.com/d/msgid/zimpy/21d57bc1-7f8a-484b-b182-59bf896248d2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
-- Humphrey Butau President: Zimbabwe Python User Group +263777216561 This e-mail was sent from a notebook running Ubuntu Vivid Vervet
To view this discussion on the web, visit https://groups.google.com/d/msgid/zimpy/565C85BD.9020808%40gmail.com.
class Post(models.Model):
time_bought = models.DateTimeField(auto_now_add=True, blank=True)
def get_age_diff(self):
age = age = datetime.datetime.now() - self.time_bought
print age # this line is never executed
return age
Cheers
--
You received this message because you are subscribed to the Google Groups "Zimbabwe Python Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zimpy+un...@googlegroups.com.
Visit this group at http://groups.google.com/group/zimpy.
To view this discussion on the web, visit https://groups.google.com/d/msgid/zimpy/afd33d87-e07a-4bd5-92b6-f630e87bf240%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.