diff --git a/polls/models.py b/polls/models.py index 2b555b9..aaef6bb 100644 --- a/polls/models.py +++ b/polls/models.py @@ -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): diff --git a/polls/views/__pycache__/__init__.cpython-38.pyc b/polls/views/__pycache__/__init__.cpython-38.pyc index 1e6d763..983abf0 100644 Binary files a/polls/views/__pycache__/__init__.cpython-38.pyc and b/polls/views/__pycache__/__init__.cpython-38.pyc differ diff --git a/polls/views/__pycache__/user.cpython-38.pyc b/polls/views/__pycache__/user.cpython-38.pyc index dddc807..149bf70 100644 Binary files a/polls/views/__pycache__/user.cpython-38.pyc and b/polls/views/__pycache__/user.cpython-38.pyc differ diff --git a/requirements.txt b/requirements.txt index b48e474..b8f8fb7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,4 +7,5 @@ aliyun-python-sdk-core-v3 channels requests parsel -django-summernote \ No newline at end of file +django-summernote +python-dateutil \ No newline at end of file