From 3e297efad8e6dbb7622cedd68a2457f00dd09080 Mon Sep 17 00:00:00 2001 From: eliott Date: Sat, 29 Dec 2007 16:42:55 -0800 Subject: Massive retab fest. Also added vim command comment to the end of files. --- news/models.py | 27 +++++++++++++++------------ news/views.py | 3 +++ 2 files changed, 18 insertions(+), 12 deletions(-) (limited to 'news') diff --git a/news/models.py b/news/models.py index 68d2865d..14837a5f 100644 --- a/news/models.py +++ b/news/models.py @@ -4,16 +4,19 @@ from archweb_dev.utils import Stripper class News(models.Model): - id = models.AutoField(primary_key=True) - author = models.ForeignKey(User) - postdate = models.DateField(auto_now_add=True) - title = models.CharField(maxlength=255) - content = models.TextField() - class Meta: - db_table = 'news' - verbose_name_plural = 'news' - get_latest_by = 'postdate' - ordering = ['-postdate', '-id'] + id = models.AutoField(primary_key=True) + author = models.ForeignKey(User) + postdate = models.DateField(auto_now_add=True) + title = models.CharField(maxlength=255) + content = models.TextField() + class Meta: + db_table = 'news' + verbose_name_plural = 'news' + get_latest_by = 'postdate' + ordering = ['-postdate', '-id'] + + def get_absolute_url(self): + return '/news/%i/' % self.id + +# vim: set ts=4 sw=4 et: - def get_absolute_url(self): - return '/news/%i/' % self.id diff --git a/news/views.py b/news/views.py index 4e4b4f0f..b618e2f9 100644 --- a/news/views.py +++ b/news/views.py @@ -80,3 +80,6 @@ def edit(request, newsid): form = forms.FormWrapper(manipulator, data, errors) return render_response(request, 'news/add.html', {'form': form, 'news':news}) + +# vim: set ts=4 sw=4 et: + -- cgit v1.2.3-54-g00ecf