summaryrefslogtreecommitdiff
path: root/sublab_project/projects
diff options
context:
space:
mode:
Diffstat (limited to 'sublab_project/projects')
-rw-r--r--sublab_project/projects/models.py25
1 files changed, 17 insertions, 8 deletions
diff --git a/sublab_project/projects/models.py b/sublab_project/projects/models.py
index b343f98..0687216 100644
--- a/sublab_project/projects/models.py
+++ b/sublab_project/projects/models.py
@@ -9,15 +9,20 @@ from utils import render_creole
class Project(models.Model):
"""A project.
"""
- name = models.CharField(max_length=100)
- slug = models.SlugField(unique=True)
- description = models.TextField()
+ name = models.CharField('Name', max_length=100)
+ slug = models.SlugField('Slug', unique=True)
+ description = models.TextField('Beschreibung')
description_html = models.TextField(editable=False)
- contact_email = models.EmailField(blank=True)
- contact_url = models.URLField(blank=True)
- contact_user = models.ForeignKey(User)
- date_created = models.DateTimeField(editable=False)
- date_updated = models.DateTimeField(editable=False)
+ contact_email = models.EmailField('E-Mail', blank=True)
+ contact_url = models.URLField('URL', blank=True)
+ contact_user = models.ForeignKey(User, verbose_name='Ansprechpartner')
+ date_created = models.DateTimeField('Erstellungsdatum', editable=False)
+ date_updated = models.DateTimeField('Aktualisierungsdatum', editable=False)
+
+ class Meta:
+ ordering = ['name']
+ verbose_name = 'Projekt'
+ verbose_name_plural = 'Projekte'
def __unicode__(self):
return self.name
@@ -28,3 +33,7 @@ class Project(models.Model):
self.date_updated = datetime.datetime.now()
self.description_html = render_creole(self.description)
return super(Project, self).save(*args, **kwargs)
+
+ @models.permalink
+ def get_absolute_url(self):
+ return ('projects_detail', (), {'id': self.id})