diff options
Diffstat (limited to 'app/gtd/models.py')
-rw-r--r-- | app/gtd/models.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/app/gtd/models.py b/app/gtd/models.py index f234c62..f99c41c 100644 --- a/app/gtd/models.py +++ b/app/gtd/models.py @@ -22,8 +22,8 @@ class GTDOutcome(models.Model): title = models.CharField(max_length=300) body_markdown = models.TextField() body_html = models.TextField(blank=True) - date_goal = models.DateField() - date_ended = models.DateField() + date_goal = models.DateField(blank=True, null=True) + date_ended = models.DateField(blank=True, null=True) def __str__(self): return self.title @@ -32,30 +32,30 @@ class GTDOutcome(models.Model): ordering = ('-date_goal',) def get_absolute_url(self): - return reverse('gtd:outcome', kwargs={"slug": self.slug}) + return reverse('gtd:outcome-detail', kwargs={"pk": self.pk}) def save(self, *args, **kwargs): created = self.pk is None if not created: md = render_images(self.body_markdown) self.body_html = markdown_to_html(md) - super(Outcome, self).save(*args, **kwargs) + super(GTDOutcome, self).save(*args, **kwargs) -class ProjectType(models.IntegerChoices): - WIRED = 0, ('Wired') - LBH = 1, ('LBH') - PERSONAL = 2, ('Personal') - class GTDProject(models.Model): + PROJECT_TYPE = ( + (0, 'Wired'), + (1, 'Lbh'), + (2, 'Personal') + ) title = models.CharField(max_length=200) short_title = models.CharField(max_length=200, blank=True, null=True) body_markdown = models.TextField(null=True, blank=True) body_html = models.TextField(blank=True) date_goal = models.DateField(blank=True, null=True) date_ended = models.DateField(blank=True, null=True) - project_type = models.IntegerField(choices=ProjectType.choices, default=ProjectType.WIRED) + project_type = models.IntegerField(choices=PROJECT_TYPE, default=2) outcome = models.ForeignKey(GTDOutcome, on_delete=models.SET_NULL, null=True, blank=True) class Meta: |