diff -r 5574cfc2b28d -r f5e18f8ed036 sphinx_django/sphinxcomment/models.py~ --- a/sphinx_django/sphinxcomment/models.py~ Thu Sep 30 15:59:32 2010 +0530 +++ b/sphinx_django/sphinxcomment/models.py~ Fri Oct 15 15:59:28 2010 +0530 @@ -2,19 +2,17 @@ # Create your models here. from django.db import models -import sha + mutable = True -class Chapter(models.Model): - id = models.CharField('ID attribute', max_length=64, editable=False, - primary_key=True) - chapter = models.CharField('Chapter ID', max_length=100, editable=False, - db_index=True) - +class Element(models.Model): + paragraph_id = models.CharField('Paragraph Id', max_length=100, editable=False, primary_key=True) + chapter_name = models.CharField('Chapter name', max_length=100, editable=False,db_index=True) + def __unicode__(self): - return self.id + return self.paragraph_id class Comment(models.Model): element = models.ForeignKey(Element, @@ -29,19 +27,8 @@ help_text='IP address from which comment was submitted') date = models.DateTimeField('date submitted', auto_now=True, auto_now_add=True) - reviewed = models.BooleanField(default=False, db_index=True, - help_text='Has this comment been reviewed by an author?') - hidden = models.BooleanField(default=False, db_index=True, - help_text='Has this comment been hidden from public display?') def __unicode__(self): return self.comment[:32] - def get_absolute_url(self): - s = sha.new() - s.update(repr(self.comment)) - s.update(repr(self.submitter_name)) - s.update(str(self.date)) - return '/read/%s.html#%s?comment=%s&uuid=%s' % ( - self.element.chapter, self.element.id, self.id, s.hexdigest()[:20] - ) +