Commit Graph

171 Commits

Author SHA1 Message Date
Arthur Hanson
829bef041d
11969 remove airflow from racktype (#17324)
* 11969 remove airflow from racktype

* 11969 remove airflow from racktype

* 11969 update docs

* 11969 fix rack edit

* Rename migration

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2024-08-30 13:30:51 -04:00
Jeremy Stretch
6f7bf5baf4 Merge branch 'develop' into feature 2024-08-29 10:51:38 -04:00
bctiemann
a150e5d561
Fixes: #16905 - Allow filtering on Device Status in InventoryItemTable (#17260)
* Add device_status as filtering option (and configurable column) for InventoryItemTable

* Add device_status to common superclasses for Device Components, and refactor ChoiceFieldColumn to support a "color" callable allowing get_FOO_color behavior to be overridden

* Remove unnecessary 'device_status' in fields

* Add unit tests for device_status
2024-08-29 08:10:30 -04:00
Arthur Hanson
796b9e84af
Closes #10500: Introduce support for nested modules (#16983)
* 10500 add ModularComponentModel

* 10500 add ModularComponentModel

* 10500 add to forms

* 10500 add to serializer, tables

* 10500 template

* 10500 add docs

* 10500 check recursion

* 10500 fix graphql

* 10500 fix conflicting migration from merge

* 10500 token resolution

* 10500 don't return reverse

* 10500 don't return reverse / optimize

* Add ModuleTypeModuleBaysView

* Fix replication of module bays on new modules

* Clean up tables & templates

* Adjust uniqueness constraints

* Correct URL

* Clean up docs

* Fix up serializers

* 10500 add filterset tests

* 10500 add nested validation to Module

* Misc cleanup

* 10500 ModuleBay recursion Test

* 10500 ModuleBay recursion Test

* 10500 ModuleBay recursion Test

* 10500 ModuleBay recursion Test

* Enable MPTT for module bays

* Fix tests

* Fix validation of module token in component names

* Misc cleanup

* Merge migrations

* Fix table ordering

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2024-08-05 13:13:59 -04:00
Arthur Hanson
d6f2fc7d29
17058 RackType name -> model (#17059)
* 17058 RackType name -> model

* 17058 RackType name -> model

* 17058 fix tests

* 17058 fix tests
2024-08-01 09:06:51 -04:00
Jeremy Stretch
c51e91dddd Closes #17048: Replace all calls to get_user_model() with direct imports of User 2024-08-01 08:17:51 -04:00
Jeremy Stretch
da7d47d3ed Add manufacturer filter for Rack; extend RackFilterForm 2024-07-31 14:06:07 -04:00
Jeremy Stretch
a12fdd6e2d Merge branch 'develop' into feature 2024-07-26 16:39:58 -04:00
Thomas Fargeix
5019a67a61 Fixes 16536 - Fix filtering of device component by device role (#16553)
* Fixes 16536 - Fix filtering of device component by device role

Rename role and role_id fields to device_role and device_role_id in
DeviceComponentFilterSet

* Update tests for DeviceComponentFilterSet

* Use device_role filter name for DeviceComponentFilterSetTests

* Add test_device_role test in InventoryItemTestCase
2024-07-26 16:20:46 -04:00
Arthur Hanson
e62a42286a
11969 airflow (#16967)
* 11960 Add airflow

* 11960 Add airflow

* 11960 fix tests

* 11960 fix racktype form

* 11969 different choices type

* 11969 update docs

* 11969 fix racktype copy

* 11969 fix

* Misc cleanup & reordering of form fields

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2024-07-25 15:14:02 -04:00
Arthur Hanson
5a6ffde67e
12826 Add Rack Type (#16739)
* 12826 add RackType

* 12826 add forms, filters, tables

* 12826 add to menu

* 12826 remove role

* 12826 add api/serializers

* 12826 add tests and fixes

* 12826 fix tests

* 12826 fix tests

* 12826 fix tests

* 12826 fix tests

* 12826 add device_type to device and instantiation

* 12826 test device creation

* 12826 add slug

* 12826 fix tests

* 12826 fix slug field

* 12826 prevent modification of rack fields if rack_type set

* 12826 update rack fields on rack_type edit

* Misc cleanup

* Update model docs

* Add manufacturer field to RackType

* Add test for mounting_depth

* Rename 'type' to 'form_factor'

* Create base classes for Rack & RackType models, serializers

* Hide RackType-defined fields on RackForm when a rack type is set

* Establish a base filter form for Rack & RackType

* Clean up RackType attr inheritance

* Clean up templates

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2024-07-16 08:58:22 -04:00
Thomas Fargeix
d39acfd3f2
Fixes 16536 - Fix filtering of device component by device role (#16553)
* Fixes 16536 - Fix filtering of device component by device role

Rename role and role_id fields to device_role and device_role_id in
DeviceComponentFilterSet

* Update tests for DeviceComponentFilterSet

* Use device_role filter name for DeviceComponentFilterSetTests

* Add test_device_role test in InventoryItemTestCase
2024-07-12 09:13:33 -04:00
Jeremy Stretch
02ae91589d Merge branch 'develop' into feature 2024-07-09 15:16:05 -04:00
Julio Oliveira at Encora
c506f60f12
16424 - Allow filtering of Devices by Cluster and Cluster Group (#16674)
* Allow filtering Devices by Cluster and Cluster Group.

* Allow filtering Devices by Cluster and Cluster Group.

* Added tests for cluster and cluster_groups filterset.

* Add missing filter & complete tests

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2024-06-26 10:13:32 -04:00
Arthur Hanson
c7176e86fc
15410 removed deprecated filters (#16410)
* 15410 removed legacy filters

* 15410 fix tests

* 15410 fix tests
2024-06-07 14:08:30 -04:00
Arthur Hanson
753c4021eb
14948 add has_virtual_device_contexts filter to device (#16209)
* 14948 add has_virtual_device_cnotexts filter to device

* 14948 make singular

* 14948 add test
2024-05-22 11:51:15 -04:00
Jeremy Stretch
a9bb4c5c3e Move choice sets from utilities.choices to netbox.choices 2024-03-22 08:59:52 -04:00
Daniel Sheppard
19f577ccaf
Closes: #13918 - Add facility field (#15456)
* Fixes: #13918 - Add facilities field to Location model.

* Stupidly forgot to `git add`

* Fix errant reference to site.

* Misc cleanup

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2024-03-18 10:09:50 -04:00
Jeremy Stretch
572efeb987 Ensure all filter labels are translated 2024-03-12 12:14:13 -04:00
Jeremy Stretch
bea32aef71 Declare FilterSet fields as a tuple 2024-03-12 12:08:11 -04:00
Jeremy Stretch
a136030094 Validate filter class for foreign key fields 2024-03-11 14:39:34 -04:00
Jeremy Stretch
b36a70d236 Add missing filters for reverse many-to-many relationships 2024-03-11 14:39:34 -04:00
Jeremy Stretch
6085e0bb0b Test for missing ManyToManyField filters 2024-03-11 14:39:34 -04:00
Jeremy Stretch
5cb7af88d4 Fix remaining tests 2024-03-11 14:39:34 -04:00
Jeremy Stretch
16b422cbac Add missing filters 2024-03-11 14:39:34 -04:00
Jeremy Stretch
d6acc18c29 Closes #15383: Standardize filtering logic for the parents of recursively-nested models 2024-03-11 13:27:57 -04:00
Jeremy Stretch
3ddacf4b88 Merge branch 'develop' into feature 2024-02-21 16:24:23 -05:00
Daniel Sheppard
29f029d480
Fixes: #14058 - Limits platform selection to manufacturer and platforms with no manufacturer (#15183)
* Fixes: #14058 - Limits platform selection to manufacturer and platforms with no manufacturer

* Apply suggestions from code review

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2024-02-20 09:28:15 -05:00
Jeremy Stretch
d8c6dad9d9 Closes #15099: Remove legacy device_role & device_role_id filters for devices 2024-02-09 15:55:03 -05:00
Jeremy Stretch
224484ebb6
Closes #14434: Add termination object filters for cables (#14617)
* Add termination object filters for cables

* Add tests for new filters
2023-12-28 15:39:14 -05:00
Jeremy Stretch
d5c1cb0ef6 Merge branch 'develop' into feature 2023-12-28 14:20:04 -05:00
Jeremy Stretch
3bacee16bd Closes #14631: Ensure description filters are available on all relevant models 2023-12-28 13:53:16 -05:00
MengYX
359c0cf3a0 Fix typo in filtersets.py
fix typo which causing exception `Cannot resolve keyword 'description_icontains' into field`
2023-12-28 08:47:43 -05:00
Jeremy Stretch
1f2f0860fe Merge branch 'develop' into feature 2023-12-27 16:34:38 -05:00
Jeremy Stretch
8a237561ef Closes #14596: Match against description field when searching for devices 2023-12-27 13:49:39 -05:00
Jeremy Stretch
d2fea4edc4
Closes #14311: Move L2VPN models from ipam to vpn (#14358)
* Move L2VPN and L2VPNTermination models from ipam to vpn

* Move L2VPN resources from ipam to vpn

* Extend migration to update content types

* Misc cleanup
2023-11-28 13:45:00 -05:00
Jeremy Stretch
ac91d4e5e5 Merge branch 'develop' into feature 2023-11-09 16:06:26 -05:00
Artem Kotik
6b89da2233
Closes #13936: Add primary_ip4 and primary_ip6 filters to VirtualMachine and VirtualDeviceContext filtersets (#14203)
* Add primary_ip4 and primary_ip6 filters for VirtualMachine and VirtualDeviceContext filtersets (#13936)

* Add PrimaryIPFilterSet to __all__

---------

Co-authored-by: Artem I. Kotik <artem.i.kotik@ringcentral.com>
Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2023-11-09 09:56:43 -05:00
Arthur Hanson
7274e75b26
13230 Allow Devices to be excluded from Rack utilization (#14099)
* 13230 add exclusion flag to device type

* 13230 forms, detail views

* 13230 add tests

* 13230 extraneous model field

* 13230 extraneous form field

* Update netbox/dcim/forms/bulk_edit.py

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>

* 13230 review feedback

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2023-10-24 11:29:24 -04:00
Arthur Hanson
18a813aa39
13972 allow filtering of cables if have terminations (#13949)
* 10769 allow filtering of cables if have terminations

* 10769 change to termianted

* 10769 add test case

* 10769 review cleanup
2023-10-17 09:32:42 -04:00
Daniel Sheppard
1854a6b76b
Fix #11478 - Add vc_interfaces flag to control selection of VC interfaces (#13296)
* Add `vc_interfaces` flag to control interface queryset

* Fix test failure

* Add new filters instead of using undocumented query params

* Cleanup filterset, add test

* Rename filter and re-introduce virtual_chassis filtering method (required)

* Fix test

* Adjust tests to more accurately provide coverage

* Add breaking change note

* Misc cleanup

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2023-08-30 09:33:02 -04:00
Jeremy Stretch
1937c1fad6 #12175: Misc cleanup 2023-08-02 11:04:28 -04:00
Abhimanyu Saharan
0bb86f1e7d
Replaces device_role with role on device model (#13342)
* replaces device_role with role on device model #6391

* fixes lint issue #6391

* revert the database user

* revert test_runner comment

* changes as per review

* Update references to device_role column in UserConfigs

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2023-08-02 09:55:52 -04:00
Abhimanyu Saharan
36f95f7842
Adds tenant on power feed (#13300)
* adds tenant on power feed

* cleanup

* adds power feed count on tenant object view

* Misc cleanup; add filterset tests

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2023-07-31 08:20:48 -04:00
Abhimanyu Saharan
0f9fe96192
Adds rf_role to interface template (#13199)
* adds rf_role to interface template #13170

* fixed migration file conflict

* Misc cleanup

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2023-07-26 09:13:24 -04:00
Jamie (Bear) Murphy
154b8236a2
Oob ip (devices) (#13013)
* initial oob_ip support for devices

* add primary ip and oob ip checkmark to ip address view

* add oob ip to device view and device edit view

* pep8

* make is_oob_ip and is_primary_ip generic for other models

* refactor oob_ip

* fix oob ip signal

* string capitalisation

* Misc cleanup

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2023-07-25 14:40:40 -04:00
Jeremy Stretch
837be4d45f Merge branch 'develop' into feature 2023-07-11 10:09:26 -04:00
Abhimanyu Saharan
ffe4558ec5 fixes search for vdc #13100 2023-07-06 09:41:43 -04:00
Arthur Hanson
518fd8cca6
12794 change User ref to get_user_model (#12905)
* 12794 change User ref to get_user_model

* 12794 call get_user_model once in tests

* 12794 call get_user_model once in tests

* 12794 use settings.AUTH_USER_MODEL for FK reference
2023-06-22 08:26:50 -04:00
Arthur Hanson
4f76dcd2ea
11305 Add GPS coordinates to device (#12782)
* 11305 add lat/long to devices

* 11305 update docs

* 11305 update tests
2023-06-14 14:18:50 -04:00