diff options
author | luxagraf <sng@luxagraf.net> | 2024-01-17 08:25:46 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2024-01-17 08:25:46 -0500 |
commit | f75f5181c25b49c51bf108357b6d9cb563055063 (patch) | |
tree | 12f2e304bcc03b15ba4a86ad6ca6914eb6653621 /app/gtd/models.py | |
parent | 67aeb0ae68b52442e7b35c4904ca86d74bae76ff (diff) |
gtd: fixed some view code and update main menu to make wired todo a
link
Diffstat (limited to 'app/gtd/models.py')
-rw-r--r-- | app/gtd/models.py | 18 |
1 files changed, 7 insertions, 11 deletions
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 |