major update

This commit is contained in:
2025-08-25 12:26:58 +05:30
parent 7cdb1a0ac4
commit 0d6aa5ad02
17 changed files with 445 additions and 179 deletions
+18
View File
@@ -92,3 +92,21 @@ class Comment(models.Model):
@property
def is_reply(self):
return self.parent is not None
class Department(models.Model):
name = models.CharField(max_length=100, unique=True)
description = models.TextField(blank=True, null=True)
created_at = models.DateTimeField(auto_now_add=True)
users = models.ManyToManyField(
User,
related_name="departments",
blank=True,
limit_choices_to={'is_staff': True}
)
class Meta:
ordering = ["name"]
def __str__(self):
return self.name.name