From 9be23e36d19c91c322f894364dde111e99aa45b5 Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Fri, 28 Nov 2025 15:45:12 +0000 Subject: [PATCH] fix tags --- core/templates/core/index.html | 3 ++- core/templates/core/kanban.html | 2 +- .../__pycache__/core_tags.cpython-311.pyc | Bin 525 -> 1019 bytes core/templatetags/core_tags.py | 12 ++++++++++++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/core/templates/core/index.html b/core/templates/core/index.html index 0c8f124..76ca06f 100644 --- a/core/templates/core/index.html +++ b/core/templates/core/index.html @@ -1,5 +1,6 @@ {% extends 'base.html' %} {% load static %} +{% load core_tags %} {% block title %}AI Task Manager - Home{% endblock %} @@ -69,7 +70,7 @@ {{ item.description|default:"" }} {% if item.tags %} - {% for tag in item.tags.split:','|slice:":3" %} + {% for tag in item.tags|split:","|slice:":3" %} {{ tag }} {% endfor %} {% endif %} diff --git a/core/templates/core/kanban.html b/core/templates/core/kanban.html index f7ab712..bdc480e 100644 --- a/core/templates/core/kanban.html +++ b/core/templates/core/kanban.html @@ -35,7 +35,7 @@

{{ item.description|default:""|truncatewords:15 }}

{% if item.tags %}
- {% for tag in item.tags.split:','|slice:":3" %} + {% for tag in item.tags|split:","|slice:":3" %} {{ tag }} {% endfor %}
diff --git a/core/templatetags/__pycache__/core_tags.cpython-311.pyc b/core/templatetags/__pycache__/core_tags.cpython-311.pyc index 4bf6d0a5808c125a3fe5710f9f2157dfbcabf55f..6dd89b89109e86bc1713c99cf3af6aaf46f06636 100644 GIT binary patch delta 541 zcmZXQPfG$p7{=e(UH`PJk`hr^G@ucCslcPrB@j;qc?i0QwM%KHF*|k$K@ZX)kX$_E zCosfM(77+5;K_S;qg!2iXHYA8VV{|Ke(%gYvrX;G7kUl`b->zvHS;;*hE_<+-8xFy zYC#jWC`)ZX7stL_2|4xt;o3j$vpg9vy>9h{^xRR2=LRv2qy;fSLtWeYfr1K5#8lof<6q9vZ_ ztS_O~;mwG&5*@8$4UO2yhz+zDGZ47VbnPyo(`g;syuwNj<(D?S%@r#)6>Hm~`4TVF z94+P@zAd{klE=9z<~auP$X4bT*ZoSwB4|hn39^h*hlvh>@MH2J*>Z+PbYw&ax)zmD z4o!diikLehwTv&f_CP}U#83a;b=j&E?R~b2P2%4<_w5&wO8Y_48ygdakoW{p-c?Y- UGs8QD8d;kF${fxN>B?)q0c!qmRR910 delta 114 zcmey(-pj(boR^o20SNxt%4K#lOyrYb44A0y&z8a*%%I6KaZfm-=427ZJVwsR&5Wwd zewu8PMVU2KIe{8hG8BO{7I6THUmP~M`6;D2sdhyIKrSN?7yC@kWp?9ZU}Tj403yJO E0kgRmN&o-= diff --git a/core/templatetags/core_tags.py b/core/templatetags/core_tags.py index 4b04b5c..11e4dda 100644 --- a/core/templatetags/core_tags.py +++ b/core/templatetags/core_tags.py @@ -5,3 +5,15 @@ register = template.Library() @register.filter def get_item(dictionary, key): return dictionary.get(key) + + +@register.filter +def get_obj_attr(obj, attr): + return getattr(obj, attr, None) + +@register.filter +def split(value, key): + """ + Returns the value turned into a list. + """ + return value.split(key) \ No newline at end of file