Closed yongbo closed 10 years ago
I wouldn't do that because you might want to save a notification without pushing it. With auto_now=True, it would always update the field whenever you call notification.save() which is undesirable.
Le mardi 26 novembre 2013, yongbo a écrit :
class Notification(models.Model):
last_sent_at = models.DateTimeField(null=True, blank=True,auto_now=True)
— Reply to this email directly or view it on GitHubhttps://github.com/stephenmuss/django-ios-notifications/issues/36#issuecomment-29269575 .
There are various reasons why a device would need to be updated and saved without updating the last_notified_at field. I think it is safer to leave it as it is.
last_notified_at = models.DateTimeField(null=True, blank=True,auto_now=True)
how about it ?