Skip to content

Commit

Permalink
Comments model feature
Browse files Browse the repository at this point in the history
  • Loading branch information
mszynka committed Mar 30, 2015
1 parent 6dd3865 commit b415924
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion blog/models.py
Expand Up @@ -54,4 +54,21 @@ class Meta:

@permalink
def get_absolute_url(self):
return ('view_blog_tag', None, {'slug': self.slug})
return ('view_blog_tag', None, {'slug': self.slug})

class Comment:
date = models.DateTimeField(auto_now_add=True)
name = models.CharField(max__length=100,blank=False)
email = models.EmailField()
website = models.URLField()
text = models.TextField
replies = models.ManyToManyField(blog.Comment)
parent = models.ForeignKey(blog.Comment)
post = models.ForeignKey(blog.post)

def __str__(self):
return self.text[0:30] #returns first n characters

class Meta:
verbose_name = 'Comment'
verbose_name_plural = 'Comments'

0 comments on commit b415924

Please sign in to comment.