Convert document comment deletion view to CBV. Remove unused document comment form.

This commit is contained in:
Roberto Rosario
2015-08-23 21:48:53 -04:00
parent a9517b9645
commit 1aadede546
5 changed files with 44 additions and 110 deletions

View File

@@ -2,11 +2,13 @@ from __future__ import unicode_literals
from django.conf import settings
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from documents.models import Document
@python_2_unicode_compatible
class Comment(models.Model):
document = models.ForeignKey(
Document, db_index=True, related_name='comments',
@@ -23,6 +25,9 @@ class Comment(models.Model):
verbose_name=_('Date time submitted')
)
def __str__(self):
return self.comment
class Meta:
get_latest_by = 'submit_date'
ordering = ('-submit_date',)