major update
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user