add tasks app
This commit is contained in:
16
core/apps/tasks/models/comment.py
Normal file
16
core/apps/tasks/models/comment.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from django.db import models
|
||||
|
||||
from django_core.models import AbstractBaseModel
|
||||
|
||||
from core.apps.tasks.choices.comment import MessageChoice
|
||||
|
||||
|
||||
class Comment(AbstractBaseModel):
|
||||
task = models.ForeignKey('tasks.Task', on_delete=models.CASCADE, related_name='comments')
|
||||
message = models.TextField()
|
||||
file = models.FileField(upload_to='comments/', blank=True, null=True)
|
||||
type = models.CharField(max_length=255, choices=MessageChoice.choices)
|
||||
created_by = models.ForeignKey('accounts.User', on_delete=models.CASCADE, related_name='comments')
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.content} created by {self.created_by}"
|
||||
Reference in New Issue
Block a user