mirror of https://github.com/snachodog/mybuddy.git
Add tags to the list view and the Api serializer
This commit is contained in:
parent
945e30adb9
commit
6c14590579
|
@ -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):
|
||||
|
|
|
@ -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">
|
||||
|
|
Loading…
Reference in New Issue