diff options
author | Filipp Lepalaan <f@230.to> | 2014-02-19 18:02:09 +0200 |
---|---|---|
committer | Filipp Lepalaan <f@230.to> | 2014-02-19 18:02:09 +0200 |
commit | 75ad7e4bd7d69243e7e5281c2642f00478fb072d (patch) | |
tree | eaaaf360902d369f42d94778aac8803db7973ce0 /apps/it/models.py | |
parent | cfc7c3f52544af8a71d3fa3988a06fee200d2c24 (diff) | |
download | pudding-75ad7e4bd7d69243e7e5281c2642f00478fb072d.tar.gz pudding-75ad7e4bd7d69243e7e5281c2642f00478fb072d.tar.bz2 pudding-75ad7e4bd7d69243e7e5281c2642f00478fb072d.zip |
Added tags, jquery UI
Diffstat (limited to 'apps/it/models.py')
-rw-r--r-- | apps/it/models.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/apps/it/models.py b/apps/it/models.py index 0ebc5d0..536518b 100644 --- a/apps/it/models.py +++ b/apps/it/models.py @@ -39,19 +39,22 @@ class Attachment(AbstractGenericItem): def __unicode__(self): import os - return os.path.basename(self.attachment.name) + path = os.path.basename(self.attachment.name) + return u'%s ...' % path[0:35] class Article(AbstractGenericItem): note = models.TextField() tags = generic.GenericRelation(TaggedItem) - title = models.CharField(max_length=256, default='New Article') + title = models.CharField(max_length=256, default=_('New Article')) class Issue(models.Model): + title = models.CharField(max_length=256, default=_('New Issue')) description = models.TextField() priority = models.PositiveIntegerField(default=0) + assigned_to = models.ForeignKey(User, null=True, related_name='issues') users = models.ManyToManyField( User, null=True, @@ -73,6 +76,9 @@ class Issue(models.Model): def __unicode__(self): return self.description + def get_content_type(self): + return ContentType.objects.get_for_model(self) + def get_absolute_url(self): return '/issues/%d/' % self.pk @@ -89,7 +95,7 @@ class Task(models.Model): blank=True, related_name='tasks') created_at = models.DateTimeField(auto_now_add=True) - due_date = models.DateField(null=True, blank=True, editable=False) + due_date = models.DateField(null=True, blank=True) updated_at = models.DateTimeField(auto_now=True) completed_at = models.DateTimeField(null=True, blank=True, editable=False) files = generic.GenericRelation(Attachment) @@ -113,7 +119,6 @@ class Asset(models.Model): ('NETWORK', _('Networking')), ('SOFTWARE', _('Software')), ('PRINTER', _('Printer')), - ('SERVICE', _('Service')), ) kind = models.CharField(choices=KINDS, max_length=128, default=KINDS[0][0]) tags = generic.GenericRelation(TaggedItem) |