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