diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | apps/it/models.py | 9 | ||||
-rw-r--r-- | apps/it/templatetags/it_tags.py | 2 |
3 files changed, 9 insertions, 3 deletions
@@ -1,3 +1,4 @@ *.pyc local_settings.py db.sqlite3 +uploads/* diff --git a/apps/it/models.py b/apps/it/models.py index 5882d3f..f1d95cc 100644 --- a/apps/it/models.py +++ b/apps/it/models.py @@ -51,10 +51,13 @@ class Article(AbstractGenericItem): class Issue(models.Model): - title = models.CharField(max_length=256, default=_('New Issue')) description = models.TextField() + title = models.CharField(max_length=256, default=_('New Issue')) priority = models.PositiveIntegerField(default=0) - assigned_to = models.ForeignKey(User, null=True, related_name='issues') + assigned_to = models.ForeignKey(User, + null=True, + blank=True, + related_name='issues') users = models.ManyToManyField( User, null=True, @@ -85,6 +88,7 @@ class Issue(models.Model): class Meta: ordering = ['-priority', 'created_at'] + class Task(models.Model): description = models.TextField() issue = models.ForeignKey(Issue, null=True, editable=False) @@ -106,6 +110,7 @@ class Task(models.Model): class Meta: ordering = ['-created_at'] + class Asset(models.Model): name = models.CharField(max_length=256, default='New Asset') description = models.TextField() diff --git a/apps/it/templatetags/it_tags.py b/apps/it/templatetags/it_tags.py index 592ac82..09c7dd1 100644 --- a/apps/it/templatetags/it_tags.py +++ b/apps/it/templatetags/it_tags.py @@ -14,7 +14,7 @@ def markdown(text): @register.simple_tag def new_issue_count(request): - return safestring.mark_safe('14') + return request.user.issues.all().count() @register.simple_tag def new_asset_count(request): |