From 4dbfe71f70610ccb7f7985ba03997f273738a550 Mon Sep 17 00:00:00 2001 From: baoliang Date: Fri, 18 Sep 2020 19:09:51 +0800 Subject: [PATCH] add message --- polls/models.py | 5 ++--- .../views/__pycache__/__init__.cpython-38.pyc | Bin 645 -> 645 bytes polls/views/__pycache__/user.cpython-38.pyc | Bin 5140 -> 5142 bytes requirements.txt | 3 ++- 4 files changed, 4 insertions(+), 4 deletions(-) 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 1e6d763ab7a1274eabaeb8cc272683a2327aa37d..983abf023599415f3f28e434d3380deb7d497d20 100644 GIT binary patch delta 20 ZcmZo=ZDr*S<>lpK0D|4VDI2+~m;flk1U&!% delta 20 acmZo=ZDr*S<>lpK0D?!yVmESEF#!N9h6L6C diff --git a/polls/views/__pycache__/user.cpython-38.pyc b/polls/views/__pycache__/user.cpython-38.pyc index dddc807292600955cd6a6dba5d728db821d45da1..149bf707912dc27769ab02ea90504dabaae7879d 100644 GIT binary patch delta 811 zcmZvaO-vI}5XUzX&*_WrR424m`F^F z#u!hUL2rH>_2Nf*(rEPN!Kv7*L z$=eBh8eb{R!6b#~BkU!(5h)L+zvN-UVSKBOX@4yV{G|@HbY^^XU`MATx#BGD${!)y zNdeQ(chkBpLmDlu3UiHb+5mL7>DW%(qaPKOFX;U+gV*#ul1X6__(+eo@{j(TpJ#>L z(Mp^x+N@X?72rB~93TV;XYse*8*{^?X@7w*A>crb9~3jrD&6>43*x1~1my63;A8y1 z(#X#sOyNo}7Cl1C^MnLpR=`xb+skBoFX@0=mX7waTonCEU@(+|d?OR;fcEaRszUy5 z>JY8wk%h0sDQi6OHo18t9TGR?nP0X=)ph0lg?X98-laUXJ_WUnfKlA?4!_hh@}`) z9HQlaC9^LUS;7exW}P3P4|VBjV6TXb1I1UHTf8OF4~TAlLGbior|TAzZvr@SE!X6W z690sAuI*!;rkcBPNn9cezkBN|mya