summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilipp Lepalaan <f@230.to>2014-02-20 16:21:50 +0200
committerFilipp Lepalaan <f@230.to>2014-02-20 16:21:50 +0200
commit993f654f7e3334b235391a8d1f779c3e715a610d (patch)
tree823c56bf0a58acb7ca157e9c06c2eb7a77bed093
parent3321241b61766045a68a3d607b67e11a95014e87 (diff)
downloadpudding-993f654f7e3334b235391a8d1f779c3e715a610d.tar.gz
pudding-993f654f7e3334b235391a8d1f779c3e715a610d.tar.bz2
pudding-993f654f7e3334b235391a8d1f779c3e715a610d.zip
Better
-rw-r--r--.gitignore1
-rw-r--r--apps/it/models.py9
-rw-r--r--apps/it/templatetags/it_tags.py2
3 files changed, 9 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index f9021cc..81357fa 100644
--- a/.gitignore
+++ b/.gitignore
@@ -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):