diff options
author | Filipp Lepalaan <f@230.to> | 2014-02-20 16:21:50 +0200 |
---|---|---|
committer | Filipp Lepalaan <f@230.to> | 2014-02-20 16:21:50 +0200 |
commit | 993f654f7e3334b235391a8d1f779c3e715a610d (patch) | |
tree | 823c56bf0a58acb7ca157e9c06c2eb7a77bed093 /apps/it | |
parent | 3321241b61766045a68a3d607b67e11a95014e87 (diff) | |
download | pudding-993f654f7e3334b235391a8d1f779c3e715a610d.tar.gz pudding-993f654f7e3334b235391a8d1f779c3e715a610d.tar.bz2 pudding-993f654f7e3334b235391a8d1f779c3e715a610d.zip |
Better
Diffstat (limited to 'apps/it')
-rw-r--r-- | apps/it/models.py | 9 | ||||
-rw-r--r-- | apps/it/templatetags/it_tags.py | 2 |
2 files changed, 8 insertions, 3 deletions
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): |