mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-08 00:28:16 -06:00
Misc cleanup
This commit is contained in:
parent
16ff3718bb
commit
33514d78b4
@ -1270,19 +1270,22 @@ class Module(PrimaryModel, ConfigContextModel):
|
|||||||
if not disable_replication:
|
if not disable_replication:
|
||||||
create_instances.append(template_instance)
|
create_instances.append(template_instance)
|
||||||
|
|
||||||
# component_model.objects.bulk_create(create_instances)
|
if component_model is not ModuleBay:
|
||||||
# # Emit the post_save signal for each newly created object
|
component_model.objects.bulk_create(create_instances)
|
||||||
# for component in create_instances:
|
# Emit the post_save signal for each newly created object
|
||||||
# post_save.send(
|
for component in create_instances:
|
||||||
# sender=component_model,
|
post_save.send(
|
||||||
# instance=component,
|
sender=component_model,
|
||||||
# created=True,
|
instance=component,
|
||||||
# raw=False,
|
created=True,
|
||||||
# using='default',
|
raw=False,
|
||||||
# update_fields=None
|
using='default',
|
||||||
# )
|
update_fields=None
|
||||||
for instance in create_instances:
|
)
|
||||||
instance.save()
|
else:
|
||||||
|
# ModuleBays must be saved individually for MPTT
|
||||||
|
for instance in create_instances:
|
||||||
|
instance.save()
|
||||||
|
|
||||||
update_fields = ['module']
|
update_fields = ['module']
|
||||||
component_model.objects.bulk_update(update_instances, update_fields)
|
component_model.objects.bulk_update(update_instances, update_fields)
|
||||||
|
@ -313,10 +313,6 @@ class ModularDeviceComponentTable(DeviceComponentTable):
|
|||||||
verbose_name=_('Inventory Items'),
|
verbose_name=_('Inventory Items'),
|
||||||
)
|
)
|
||||||
|
|
||||||
class Meta(NetBoxTable.Meta):
|
|
||||||
pass
|
|
||||||
# order_by = ('device', 'module', 'name')
|
|
||||||
|
|
||||||
|
|
||||||
class CableTerminationTable(NetBoxTable):
|
class CableTerminationTable(NetBoxTable):
|
||||||
cable = tables.Column(
|
cable = tables.Column(
|
||||||
|
Loading…
Reference in New Issue
Block a user