Add tags to the list view and the Api serializer

This commit is contained in:
Brian O'Connor 2023-01-29 09:38:54 -05:00 committed by Christopher Charbonneau Wells
parent 945e30adb9
commit 6c14590579
2 changed files with 7 additions and 3 deletions

View File

@ -121,10 +121,10 @@ class BMISerializer(CoreModelSerializer, TaggableSerializer):
}
class PumpingSerializer(CoreModelSerializer):
class PumpingSerializer(CoreModelSerializer, TaggableSerializer):
class Meta:
model = models.Pumping
fields = ("id", "child", "amount", "time", "notes")
fields = ("id", "child", "amount", "time", "notes", "tags")
class ChildSerializer(serializers.HyperlinkedModelSerializer):

View File

@ -27,6 +27,7 @@
<th>{% trans "Child" %}</th>
{% endif %}
<th>{% trans "Amount" %}</th>
<th>{% trans "Tags" %}</th>
</tr>
</thead>
<tbody>
@ -55,6 +56,9 @@
<td><a href="{% url 'core:child' pumping.child.slug %}">{{ pumping.child }}</a></td>
{% endif %}
<td>{{ pumping.amount }}</td>
<td>
{% include "core/render_tag_list.html" with tags=pumping.tags.all %}
</td>
</tr>
{% if pumping.notes %}
<tr class="{{ row_class }} row-details">