Add a created_at_rss method to the blog Post model
This commit is contained in:
parent
337e1eea2b
commit
ed7a61207a
@ -21,6 +21,9 @@ class Post(models.Model):
|
|||||||
|
|
||||||
super(Post, self).save(*args, **kwargs)
|
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):
|
class CodeChunk(models.Model):
|
||||||
language = models.CharField(max_length = 20)
|
language = models.CharField(max_length = 20)
|
||||||
created_at = models.DateTimeField(auto_now_add = True)
|
created_at = models.DateTimeField(auto_now_add = True)
|
||||||
|
Loading…
Reference in New Issue
Block a user