170 |
170 |
171 class Notification(models.Model): |
171 class Notification(models.Model): |
172 |
172 |
173 role = models.CharField(max_length = 2, choices = NOTIFY_CHOICES, blank = False) |
173 role = models.CharField(max_length = 2, choices = NOTIFY_CHOICES, blank = False) |
174 sent_to = models.ForeignKey(User, related_name = "%(class)s_sent_to", blank = False) |
174 sent_to = models.ForeignKey(User, related_name = "%(class)s_sent_to", blank = False) |
175 sent_from = models.ForeignKey(User, related_name = "%(class)s_sent_from", blank = True) |
175 sent_from = models.ForeignKey(User, related_name = "%(class)s_sent_from", null = True, blank = True) |
176 task = models.ForeignKey(Task, related_name = "%(class)s_sent_for", blank = False) |
176 task = models.ForeignKey(Task, related_name = "%(class)s_sent_for", null = True, blank = True) |
177 |
177 |
178 |
178 |
179 sub = models.CharField(max_length = 100) |
179 sub = models.CharField(max_length = 100) |
180 message = models.TextField() |
180 message = models.TextField() |
181 remark = models.CharField(max_length = 100) |
181 remarks = models.CharField(max_length = 100) |
182 |
182 |
183 sent_date = models.DateTimeField() |
183 sent_date = models.DateTimeField() |
184 is_read = models.BooleanField(default = False) |
184 is_read = models.BooleanField(default = False) |
185 is_deleted = models.BooleanField(default = False) |
185 is_deleted = models.BooleanField(default = False) |
186 |
186 |