Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closes #10500: Introduce support for nested modules #16983

Merged
merged 40 commits into from
Aug 5, 2024
Merged
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
81b8152
10500 add ModularComponentModel
arthanson Jul 23, 2024
d293a8b
Merge branch 'feature' into 10500-nested-modules
arthanson Jul 23, 2024
4bd27ed
10500 add ModularComponentModel
arthanson Jul 23, 2024
d72d748
10500 add to forms
arthanson Jul 23, 2024
2b41ba6
10500 add to serializer, tables
arthanson Jul 24, 2024
61d84ef
10500 template
arthanson Jul 24, 2024
097e1a6
Merge branch 'feature' into 10500-nested-modules
arthanson Jul 25, 2024
f1e5d14
10500 add docs
arthanson Jul 25, 2024
0c7fb56
10500 check recursion
arthanson Jul 25, 2024
fda7a99
10500 fix graphql
arthanson Jul 26, 2024
c7c6e78
Merge branch 'feature' into 10500-nested-modules
arthanson Jul 26, 2024
844fb1f
10500 fix conflicting migration from merge
arthanson Jul 26, 2024
702c862
10500 token resolution
arthanson Jul 26, 2024
7385c07
10500 don't return reverse
arthanson Jul 29, 2024
acfbae3
Merge branch 'feature' into 10500-nested-modules
arthanson Jul 29, 2024
94316e8
10500 don't return reverse / optimize
arthanson Jul 29, 2024
399a2d6
Add ModuleTypeModuleBaysView
jeremystretch Jul 29, 2024
a16ad74
Fix replication of module bays on new modules
jeremystretch Jul 29, 2024
6144409
Clean up tables & templates
jeremystretch Jul 29, 2024
e583ffa
Adjust uniqueness constraints
jeremystretch Jul 29, 2024
b17ea30
Correct URL
jeremystretch Jul 29, 2024
901215b
Clean up docs
jeremystretch Jul 29, 2024
b5dab4d
Fix up serializers
jeremystretch Jul 29, 2024
a99431e
10500 add filterset tests
arthanson Jul 30, 2024
b7012a0
Merge branch 'feature' into 10500-nested-modules
arthanson Jul 30, 2024
07f497e
Merge branch 'feature' into 10500-nested-modules
arthanson Jul 31, 2024
cf6d336
Merge branch 'feature' into 10500-nested-modules
arthanson Jul 31, 2024
ce69379
10500 add nested validation to Module
arthanson Jul 31, 2024
6bacc13
Misc cleanup
jeremystretch Aug 1, 2024
16e9a9c
Merge branch 'feature' into 10500-nested-modules
arthanson Aug 2, 2024
b4b3ac1
10500 ModuleBay recursion Test
arthanson Aug 2, 2024
4af817f
10500 ModuleBay recursion Test
arthanson Aug 2, 2024
2309be9
10500 ModuleBay recursion Test
arthanson Aug 2, 2024
f8d99ff
10500 ModuleBay recursion Test
arthanson Aug 5, 2024
6372d06
Enable MPTT for module bays
jeremystretch Aug 2, 2024
febb5da
Fix tests
jeremystretch Aug 5, 2024
16ff371
Fix validation of module token in component names
jeremystretch Aug 5, 2024
33514d7
Misc cleanup
jeremystretch Aug 5, 2024
d39ccac
Merge migrations
jeremystretch Aug 5, 2024
5150827
Fix table ordering
jeremystretch Aug 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Misc cleanup
jeremystretch committed Aug 5, 2024
commit 33514d78b4109b3c416914200358571b85e40c11
29 changes: 16 additions & 13 deletions netbox/dcim/models/devices.py
Original file line number Diff line number Diff line change
@@ -1270,19 +1270,22 @@ def save(self, *args, **kwargs):
if not disable_replication:
create_instances.append(template_instance)

# component_model.objects.bulk_create(create_instances)
# # Emit the post_save signal for each newly created object
# for component in create_instances:
# post_save.send(
# sender=component_model,
# instance=component,
# created=True,
# raw=False,
# using='default',
# update_fields=None
# )
for instance in create_instances:
instance.save()
if component_model is not ModuleBay:
component_model.objects.bulk_create(create_instances)
# Emit the post_save signal for each newly created object
for component in create_instances:
post_save.send(
sender=component_model,
instance=component,
created=True,
raw=False,
using='default',
update_fields=None
)
else:
# ModuleBays must be saved individually for MPTT
for instance in create_instances:
instance.save()

update_fields = ['module']
component_model.objects.bulk_update(update_instances, update_fields)
4 changes: 0 additions & 4 deletions netbox/dcim/tables/devices.py
Original file line number Diff line number Diff line change
@@ -313,10 +313,6 @@ class ModularDeviceComponentTable(DeviceComponentTable):
verbose_name=_('Inventory Items'),
)

class Meta(NetBoxTable.Meta):
pass
# order_by = ('device', 'module', 'name')


class CableTerminationTable(NetBoxTable):
cable = tables.Column(