From b61874bcbbb6e85d90fb3a851d597214af0e45d4 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Wed, 11 Oct 2017 19:04:59 +0300 Subject: [PATCH] Add comments --- webapp/models.py | 4 +++- webapp/templates/kaehmy_list.html | 6 ++++++ webapp/templates/kaehmy_message.html | 10 ++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 webapp/templates/kaehmy_message.html diff --git a/webapp/models.py b/webapp/models.py index 687251d..1a3a9aa 100644 --- a/webapp/models.py +++ b/webapp/models.py @@ -117,7 +117,9 @@ class KaehmyFormSelectedRole(models.Model): class MessageParent(models.Model): - pass + + def __str__(self): + return 'Message parent #{}'.format(self.id) class KaehmyMessage(MessageParent): diff --git a/webapp/templates/kaehmy_list.html b/webapp/templates/kaehmy_list.html index 9ff354c..3960341 100644 --- a/webapp/templates/kaehmy_list.html +++ b/webapp/templates/kaehmy_list.html @@ -27,6 +27,12 @@ {% for role in application.preset_roles.all %}
{{ role.name }}
{% endfor %} + +

{{ application.text }}

+ + {% for message in application.messages.all %} + {% include "kaehmy_message.html" with messages=message.messages.all %} + {% endfor %} {% endfor %} diff --git a/webapp/templates/kaehmy_message.html b/webapp/templates/kaehmy_message.html new file mode 100644 index 0000000..ebdcff5 --- /dev/null +++ b/webapp/templates/kaehmy_message.html @@ -0,0 +1,10 @@ +
+
+

{{ message.name }}

+

{{ message.message }}

+ + {% for message in messages %} + {% include "kaehmy_message.html" with messages=message.messages.all %} + {% endfor %} +
+
\ No newline at end of file