sphinx_django/sphinxcomment/models.py
changeset 2 f5e18f8ed036
parent 0 54f784230511
equal deleted inserted replaced
1:5574cfc2b28d 2:f5e18f8ed036
     5 
     5 
     6 
     6 
     7 mutable = True
     7 mutable = True
     8 
     8 
     9 class Element(models.Model):
     9 class Element(models.Model):
    10     chapter_name = models.CharField('Chapter name', max_length=100, editable=False,
    10     paragraph_id = models.CharField('Paragraph Id', max_length=100, editable=False, primary_key=True) 
    11                                db_index=True)
    11     chapter_name = models.CharField('Chapter name', max_length=100, editable=False,db_index=True)
    12 
    12     
    13 
    13 
    14     def __unicode__(self):
    14     def __unicode__(self):
    15         return self.chapter_name
    15         return self.paragraph_id
    16     
    16     
    17 class Comment(models.Model):
    17 class Comment(models.Model):
    18     element = models.ForeignKey(Element,
    18     element = models.ForeignKey(Element,
    19         help_text='ID of paragraph that was commented on')
    19         help_text='ID of paragraph that was commented on')
    20     comment = models.TextField(editable=mutable,
    20     comment = models.TextField(editable=mutable,