stephenmuss / django-ios-notifications

Django iOS Notifications makes it easy to send push notifications to iOS devices
Other
230 stars 72 forks source link

Device's last_notified_at field should use auto_now #36

Closed yongbo closed 10 years ago

yongbo commented 10 years ago

last_notified_at = models.DateTimeField(null=True, blank=True,auto_now=True)

how about it ?

mbargiel commented 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 .

stephenmuss commented 10 years ago

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.