diff --git a/tasks/apps/tree/migrations/0039_habit_description.py b/tasks/apps/tree/migrations/0039_habit_description.py new file mode 100644 index 0000000..2bf7fcc --- /dev/null +++ b/tasks/apps/tree/migrations/0039_habit_description.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.16 on 2024-09-29 08:38 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("tree", "0038_alter_habit_slug_alter_habit_tagname"), + ] + + operations = [ + migrations.AddField( + model_name="habit", + name="description", + field=models.TextField(blank=True, null=True), + ), + ] diff --git a/tasks/apps/tree/models.py b/tasks/apps/tree/models.py index db2a055..466811c 100644 --- a/tasks/apps/tree/models.py +++ b/tasks/apps/tree/models.py @@ -91,9 +91,10 @@ class Habit(models.Model): # hashtag for matching tagname = models.SlugField(max_length=255, unique=True, allow_unicode=True) - # XXX event stream id based on name, need rehash on... other field? event_stream_id = models.UUIDField(default=uuid.uuid4, editable=False) + description = models.TextField(null=True, blank=True) + def __str__(self): return self.name diff --git a/tasks/templates/tree/habit_list.html b/tasks/templates/tree/habit_list.html index 28c7522..4f550bc 100644 --- a/tasks/templates/tree/habit_list.html +++ b/tasks/templates/tree/habit_list.html @@ -17,10 +17,10 @@

Habits

{% for habit in object_list %}
- {{ habit.name }} + {{ habit.as_hashtag }} ({{ habit.name }})
- {{ habit.as_hashtag }} + {{ habit.description }}
{% endfor %}