From f75f5181c25b49c51bf108357b6d9cb563055063 Mon Sep 17 00:00:00 2001 From: luxagraf Date: Wed, 17 Jan 2024 08:25:46 -0500 Subject: gtd: fixed some view code and update main menu to make wired todo a link --- app/gtd/models.py | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'app/gtd/models.py') diff --git a/app/gtd/models.py b/app/gtd/models.py index cf0d086..fd4a11a 100644 --- a/app/gtd/models.py +++ b/app/gtd/models.py @@ -87,6 +87,12 @@ class GTDProject(models.Model): self.body_html = markdown_to_html(md) super(GTDProject, self).save(*args, **kwargs) +class NoteType(models.IntegerChoices): + ACTION = 0, ('Action') + REMINDER = 1, ('Reminder') + REFERENCE = 2, ('Reference') + SOMEDAY = 3, ('Someday') + class GTDNote(models.Model): title = models.CharField(max_length=200) @@ -95,17 +101,7 @@ class GTDNote(models.Model): body_html = models.TextField(blank=True) date_completed = models.DateField(null=True, blank=True) date_created = models.DateTimeField(auto_now=True) - ACTION = 0 - REMINDER = 1 - REFERENCE = 2 - SOMEDAY = 3 - NOTE_TYPE = [ - (ACTION, 'Action'), - (REMINDER, 'Reminder'), - (REFERENCE, 'Reference'), - (SOMEDAY, 'Someday'), - ] - note_type = models.SmallIntegerField(choices=NOTE_TYPE, default=ACTION) + note_type = models.SmallIntegerField(choices=NoteType.choices, default=NoteType.ACTION) reminder = models.BigIntegerField(help_text="In days", null=True, blank=True) project = models.ForeignKey(GTDProject, on_delete=models.SET_NULL, null=True, blank=True) NONE = 0 -- cgit v1.2.3-70-g09d2