mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
12552 test fixes
This commit is contained in:
@ -149,4 +149,12 @@ class Migration(migrations.Migration):
|
|||||||
name='inventoryitem',
|
name='inventoryitem',
|
||||||
options={'ordering': ('_name',)},
|
options={'ordering': ('_name',)},
|
||||||
),
|
),
|
||||||
|
migrations.AlterModelOptions(
|
||||||
|
name='inventoryitemtemplate',
|
||||||
|
options={'ordering': ('_name',)},
|
||||||
|
),
|
||||||
|
migrations.AlterModelOptions(
|
||||||
|
name='location',
|
||||||
|
options={'ordering': ('name',)},
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
@ -663,7 +663,7 @@ class InventoryItemTemplate(TreeNode, ComponentTemplateModel):
|
|||||||
component_model = InventoryItem
|
component_model = InventoryItem
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
ordering = ('device_type__id', 'parent__id', '_name')
|
ordering = ('_name', )
|
||||||
constraints = (
|
constraints = (
|
||||||
models.UniqueConstraint(
|
models.UniqueConstraint(
|
||||||
fields=('device_type', 'parent', 'name'),
|
fields=('device_type', 'parent', 'name'),
|
||||||
|
@ -1128,7 +1128,6 @@ class InventoryItem(TreeNode, ComponentModel):
|
|||||||
clone_fields = ('device', 'parent', 'role', 'manufacturer', 'part_id',)
|
clone_fields = ('device', 'parent', 'role', 'manufacturer', 'part_id',)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
# ordering = ('device__id', 'parent__id', '_name')
|
|
||||||
ordering = ('_name', )
|
ordering = ('_name', )
|
||||||
constraints = (
|
constraints = (
|
||||||
models.UniqueConstraint(
|
models.UniqueConstraint(
|
||||||
|
@ -294,7 +294,7 @@ class Location(NestedGroupModel):
|
|||||||
)
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
ordering = ['site', 'name']
|
ordering = ('name', )
|
||||||
constraints = (
|
constraints = (
|
||||||
models.UniqueConstraint(
|
models.UniqueConstraint(
|
||||||
fields=('site', 'parent', 'name'),
|
fields=('site', 'parent', 'name'),
|
||||||
|
@ -857,7 +857,7 @@ class InventoryItemTable(DeviceComponentTable):
|
|||||||
|
|
||||||
class DeviceInventoryItemTable(InventoryItemTable):
|
class DeviceInventoryItemTable(InventoryItemTable):
|
||||||
name = tables.TemplateColumn(
|
name = tables.TemplateColumn(
|
||||||
template_code='<a href="{{ record.get_absolute_url }}" style="padding-left: {{ record.level }}0px">'
|
template_code='<a href="{{ record.get_absolute_url }}" style="padding-left: {{ record.tree_depth }}0px">'
|
||||||
'{{ value }}</a>',
|
'{{ value }}</a>',
|
||||||
order_by=Accessor('_name'),
|
order_by=Accessor('_name'),
|
||||||
attrs={'td': {'class': 'text-nowrap'}}
|
attrs={'td': {'class': 'text-nowrap'}}
|
||||||
|
@ -145,7 +145,7 @@
|
|||||||
{% for location in locations %}
|
{% for location in locations %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
{% for i in location.level|as_range %}<i class="mdi mdi-circle-small"></i>{% endfor %}
|
{% for i in location.tree_depth|as_range %}<i class="mdi mdi-circle-small"></i>{% endfor %}
|
||||||
{{ location|linkify }}
|
{{ location|linkify }}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
@ -155,8 +155,8 @@ def serialize_object(obj, resolve_tags=True, extra=None):
|
|||||||
|
|
||||||
# Exclude any TreeNode fields
|
# Exclude any TreeNode fields
|
||||||
if issubclass(obj.__class__, TreeNode):
|
if issubclass(obj.__class__, TreeNode):
|
||||||
for field in ['level', 'lft', 'rght', 'tree_id']:
|
for field in ['tree_depth', 'tree_path', 'tree_ordering']:
|
||||||
data.pop(field)
|
data.pop(field, None)
|
||||||
|
|
||||||
# Include custom_field_data as "custom_fields"
|
# Include custom_field_data as "custom_fields"
|
||||||
if hasattr(obj, 'custom_field_data'):
|
if hasattr(obj, 'custom_field_data'):
|
||||||
|
@ -37,4 +37,8 @@ class Migration(migrations.Migration):
|
|||||||
to='wireless.wirelesslangroup',
|
to='wireless.wirelesslangroup',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
migrations.AlterModelOptions(
|
||||||
|
name='wirelesslangroup',
|
||||||
|
options={'ordering': ('name',), 'verbose_name': 'Wireless LAN Group'},
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
@ -54,7 +54,7 @@ class WirelessLANGroup(NestedGroupModel):
|
|||||||
)
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
ordering = ('name', 'pk')
|
ordering = ('name', )
|
||||||
constraints = (
|
constraints = (
|
||||||
models.UniqueConstraint(
|
models.UniqueConstraint(
|
||||||
fields=('parent', 'name'),
|
fields=('parent', 'name'),
|
||||||
|
Reference in New Issue
Block a user