1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Closes #9971: Enable ordering of nested group models by name

This commit is contained in:
jeremystretch
2022-12-15 16:21:30 -05:00
parent e4f5407c70
commit 9f15ca2d90
2 changed files with 7 additions and 2 deletions

View File

@ -2,6 +2,10 @@
## v3.4.1 (FUTURE) ## v3.4.1 (FUTURE)
### Enhancements
* [#9971](https://github.com/netbox-community/netbox/issues/9971) - Enable ordering of nested group models by name
### Bug Fixes ### Bug Fixes
* [#11175](https://github.com/netbox-community/netbox/issues/11175) - Fix cloning of fields containing special characters * [#11175](https://github.com/netbox-community/netbox/issues/11175) - Fix cloning of fields containing special characters

View File

@ -537,14 +537,15 @@ class MPTTColumn(tables.TemplateColumn):
""" """
template_code = """ template_code = """
{% load helpers %} {% load helpers %}
{% for i in record.level|as_range %}<i class="mdi mdi-circle-small"></i>{% endfor %} {% if not table.order_by %}
{% for i in record.level|as_range %}<i class="mdi mdi-circle-small"></i>{% endfor %}
{% endif %}
<a href="{{ record.get_absolute_url }}">{{ record.name }}</a> <a href="{{ record.get_absolute_url }}">{{ record.name }}</a>
""" """
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super().__init__( super().__init__(
template_code=self.template_code, template_code=self.template_code,
orderable=False,
attrs={'td': {'class': 'text-nowrap'}}, attrs={'td': {'class': 'text-nowrap'}},
*args, *args,
**kwargs **kwargs