Skip to content

Commit

Permalink
#7025: Misc cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremystretch committed Jul 30, 2024
1 parent d3a3a6b commit dbd503b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
1 change: 1 addition & 0 deletions netbox/circuits/forms/model_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ class CircuitGroupAssignmentForm(NetBoxModelForm):
circuit = DynamicModelChoiceField(
label=_('Circuit'),
queryset=Circuit.objects.all(),
selector=True
)

class Meta:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class Migration(migrations.Migration):
options={
'verbose_name': 'Circuit group assignment',
'verbose_name_plural': 'Circuit group assignments',
'ordering': ('circuit', 'priority', 'pk'),
'ordering': ('group', 'circuit', 'priority', 'pk'),
},
),
migrations.AddConstraint(
Expand Down
2 changes: 1 addition & 1 deletion netbox/circuits/models/circuits.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ class CircuitGroupAssignment(CustomFieldsMixin, ExportTemplatesMixin, TagsMixin,
)

class Meta:
ordering = ('circuit', 'priority', 'pk')
ordering = ('group', 'circuit', 'priority', 'pk')
constraints = (
models.UniqueConstraint(
fields=('circuit', 'group'),
Expand Down
8 changes: 6 additions & 2 deletions netbox/circuits/tables/circuits.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,22 @@ class CircuitTable(TenancyColumnsMixin, ContactsColumnMixin, NetBoxTable):
verbose_name=_('Commit Rate')
)
comments = columns.MarkdownColumn(
verbose_name=_('Comments'),
verbose_name=_('Comments')
)
tags = columns.TagColumn(
url_name='circuits:circuit_list'
)
assignments = columns.ManyToManyColumn(
verbose_name=_('Assignments'),
linkify_item=True
)

class Meta(NetBoxTable.Meta):
model = Circuit
fields = (
'pk', 'id', 'cid', 'provider', 'provider_account', 'type', 'status', 'tenant', 'tenant_group',
'termination_a', 'termination_z', 'install_date', 'termination_date', 'commit_rate', 'description',
'comments', 'contacts', 'tags', 'created', 'last_updated',
'comments', 'contacts', 'tags', 'created', 'last_updated', 'assignments',
)
default_columns = (
'pk', 'cid', 'provider', 'type', 'status', 'tenant', 'termination_a', 'termination_z', 'description',
Expand Down
8 changes: 4 additions & 4 deletions netbox/templates/circuits/circuitgroupassignment.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,23 @@ <h5 class="card-header">{% trans "Circuit Group Assignment" %}</h5>
<table class="table table-hover attr-table">
<tr>
<th scope="row">{% trans "Group" %}</th>
<td>{{ object.group }}</td>
<td>{{ object.group|linkify }}</td>
</tr>
<tr>
<th scope="row">{% trans "Circuit" %}</th>
<td>{{ object.circuit }}</td>
<td>{{ object.circuit|linkify }}</td>
</tr>
<tr>
<th scope="row">{% trans "Priority" %}</th>
<td>{{ object.priority }}</td>
<td>{{ object.get_priority_display }}</td>
</tr>
</table>
</div>
{% include 'inc/panels/tags.html' %}
{% include 'inc/panels/custom_fields.html' %}
{% plugin_left_page object %}
</div>
<div class="col col-md-6">
{% include 'inc/panels/custom_fields.html' %}
{% plugin_right_page object %}
</div>
</div>
Expand Down

0 comments on commit dbd503b

Please sign in to comment.