Add a created_at_rss method to the blog Post model

This commit is contained in:
Gergely Polonkai 2014-06-21 22:06:42 +02:00
parent 337e1eea2b
commit ed7a61207a
1 changed files with 3 additions and 0 deletions

View File

@ -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)