Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions heythere/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ class Notification(models.Model):
The `headline` and `body` fields should be filled in
using the template keys in the chosen notification type.
"""
timestamp = models.DateTimeField(auto_now=True)
created = models.DateTimeField(auto_now_add=True)
modified = models.DateTimeField(auto_now=True)
sent_at = models.DateTimeField(null=True, blank=True)
active = models.BooleanField(default=True)
user = models.ForeignKey(django_settings.AUTH_USER_MODEL,
Expand All @@ -107,10 +108,10 @@ def __init__(self, *args, **kwargs):
get_notification_types, list)()

class Meta:
ordering = ['-timestamp']
ordering = ['-created']

def __unicode__(self):
return u'{0.timestamp:%Y/%m/%d %H:%M} - {0.user}'.format(self)
return u'{0.created:%Y/%m/%d %H:%M} - {0.user}'.format(self)

def save(self, *args, **kwargs):
if not hasattr(self.headline_dict, 'keys'):
Expand Down