diff --git a/scipost/models.py b/scipost/models.py index bc1395d9aed8ff8bd567928510bda2093a80d1bb..e55e21212f59b31cd8e58c8d81ae2679b3549f51 100644 --- a/scipost/models.py +++ b/scipost/models.py @@ -179,6 +179,19 @@ TITLE_CHOICES = ( title_dict = dict(TITLE_CHOICES) +class TimeStampedModel(models.Model): + """ + All objects should inherit from this abstract model. + This will ensure the creation of created and modified + timestamps in the objects. + """ + created = models.DateTimeField(auto_now_add=True) + latest_activity = models.DateTimeField(auto_now=True) + + class Meta: + abstract = True + + class Contributor(models.Model): """ All users of SciPost are Contributors. @@ -258,7 +271,7 @@ class Contributor(models.Model): def public_info_as_table(self): """Prints out all publicly-accessible info as a table.""" - + template = Template(''' <table> <tr><td>Title: </td><td> </td><td>{{ title }}</td></tr>