Fix chat box and add Delete feature

This commit is contained in:
thanhluong 2020-05-05 18:17:42 +00:00
parent 005ac64be7
commit 5b1de72270
5 changed files with 51 additions and 5 deletions

View file

@ -15,6 +15,7 @@ class Message(models.Model):
author = models.ForeignKey(Profile, verbose_name=_('user'), on_delete=CASCADE)
time = models.DateTimeField(verbose_name=_('posted time'), auto_now_add=True)
body = models.TextField(verbose_name=_('body of comment'), max_length=8192)
hidden = models.BooleanField(verbose_name='is hidden', default=False)
def save(self, *args, **kwargs):
new_message = self.id