Author: batiste.bieler
Date: Wed Apr 15 00:27:06 2009
New Revision: 450
Modified:
trunk/pages/models.py
trunk/pages/tests.py
Log:
Add last_modification_date field in the Page model
Modified: trunk/pages/models.py
==============================================================================
--- trunk/pages/models.py (original)
+++ trunk/pages/models.py Wed Apr 15 00:27:06 2009
@@ -49,6 +49,8 @@
null=True, blank=True, help_text=_('''When to expire the page.
Leave
empty to never expire.'''))
+ last_modification_date = models.DateTimeField(_('last modification
date'))
+
status = models.IntegerField(_('status'), choices=STATUSES,
default=DRAFT)
template = models.CharField(_('template'), max_length=100, null=True,
blank=True)
@@ -82,6 +84,7 @@
self.publication_date = None
else:
self.publication_date = None
+ self.last_modification_date = datetime.now()
super(Page, self).save(*args, **kwargs)
def get_calculated_status(self):
Modified: trunk/pages/tests.py
==============================================================================
--- trunk/pages/tests.py (original)
+++ trunk/pages/tests.py Wed Apr 15 00:27:06 2009
@@ -44,6 +44,7 @@
page = slug_content.page
self.assertEqual(page.title(), page_data['title'])
self.assertEqual(page.slug(), page_data['slug'])
+ self.assertNotEqual(page.last_modification_date, None)
def test_03_slug_collision(self):
"""
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pinax-updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/pinax-updates?hl=en
-~----------~----~----~----~------~----~------~--~---