mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 12:06:44 +00:00
Added links to child categories
This commit is contained in:
parent
ef8cfa794f
commit
3f81046a26
@ -4,6 +4,10 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{{ category.name }}
|
{{ category.name }}
|
||||||
|
|
||||||
|
<br><br>Children:<br>
|
||||||
|
{% for child in children %}
|
||||||
|
<a href="/part/category/{{ child.pk }}">{{ child.name }}</a><br>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
@ -18,5 +18,10 @@ def category(request, category_id):
|
|||||||
# Find the category
|
# Find the category
|
||||||
cat = get_object_or_404(PartCategory, pk=category_id)
|
cat = get_object_or_404(PartCategory, pk=category_id)
|
||||||
|
|
||||||
|
# Child categories
|
||||||
|
childs = PartCategory.objects.filter(parent = cat.pk)
|
||||||
|
|
||||||
return render(request, 'part/category.html',
|
return render(request, 'part/category.html',
|
||||||
{'category': cat})
|
{'category': cat,
|
||||||
|
'children': childs
|
||||||
|
})
|
Loading…
x
Reference in New Issue
Block a user