From ed7a61207ad8d6e53c92f802c55d711a7a0ee2b2 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Sat, 21 Jun 2014 22:06:42 +0200 Subject: [PATCH] Add a created_at_rss method to the blog Post model --- blog/models.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/blog/models.py b/blog/models.py index eda5dad..067b330 100644 --- a/blog/models.py +++ b/blog/models.py @@ -21,6 +21,9 @@ class Post(models.Model): super(Post, self).save(*args, **kwargs) + def created_at_rss(self): + return self.created_at.strftime('%a, %d %b %Y %T %z') + class CodeChunk(models.Model): language = models.CharField(max_length = 20) created_at = models.DateTimeField(auto_now_add = True)