add message

This commit is contained in:
baoliang 2020-09-18 19:09:51 +08:00
parent 0c6f2d31f6
commit 4dbfe71f70
4 changed files with 4 additions and 4 deletions

View File

@ -54,7 +54,7 @@ class Notice(models.Model):
class Task(models.Model):
id = models.UUIDField('id', primary_key=True, default=uuid.uuid4)
created_by = models.ForeignKey(User, on_delete=models.SET_NULL)
created_by = models.ForeignKey(User, on_delete=models.CASCADE)
groups = models.ManyToManyField(Group)
content = models.TextField('内容', null=True, blank=True)
added = models.DateTimeField(auto_now_add=True)
@ -110,7 +110,6 @@ class Message(models.Model):
send_to = models.ForeignKey(Group, on_delete=models.CASCADE)
content = models.TextField('内容', null=True, blank=True)
task = models.ForeignKey(Task, on_delete=models.CASCADE)
addition = models.ForeignKey(MessageAddition, on_delete=models.CASCADE)
added = models.DateTimeField(auto_now_add=True)
updated = models.DateTimeField(auto_now=True)
@ -119,7 +118,7 @@ class Message(models.Model):
ordering = ["-added"]
def __str__(self):
return self.send_from + ':' + self.send_to
return self.send_from + ':' + self.send_toÒ
class MessageAddition(models.Model):

View File

@ -7,4 +7,5 @@ aliyun-python-sdk-core-v3
channels
requests
parsel
django-summernote
django-summernote
python-dateutil