Commit Graph

43 Commits

Author SHA1 Message Date
bctiemann 0eb1fcc09c
Closes #22682: Fix CachedScopeMixin cache fields cascading on ancestor deletion (#22693)
CachedScopeMixin._region and ._site_group may cache ancestors of a
Site or Location scope. Change these relationships to SET_NULL so
deleting a Region or SiteGroup clears the cached value instead of
deleting the scoped Prefix, Cluster, or WirelessLAN.

Add reverse GenericRelation fields for Cluster and WirelessLAN on
Region and SiteGroup. This preserves the expected cascade when a
Region or SiteGroup is itself the direct scope, matching the existing
Prefix behavior.

Add migrations recording the ORM-level on_delete changes and regression
coverage for Site, Location, and direct Region/SiteGroup scopes.
2026-07-18 10:35:08 +02:00
Jeremy Stretch 315fcdffb6 Merge branch 'main' into feature 2026-04-10 14:58:07 -04:00
Jeremy Stretch 2b1f4ab51a Add migration files for indexes 2026-04-03 16:32:08 -04:00
Jason Novinger 0b7375136d
Closes #21016: Add missing MPTT tree indexes (#21432)
Upgrade django-mptt to 0.18.0 and add empty indexes tuple to MPTT model
Meta classes. The empty tuple triggers Django's migration detection for
indexes that django-mptt adds dynamically (see
django-mptt/django-mptt#682). We cannot define the indexes explicitly
because the MPTT fields don't exist when the Meta class is evaluated.

Affected models: Region, SiteGroup, Location, DeviceRole, Platform,
ModuleBay, InventoryItem, InventoryItemTemplate, TenantGroup,
ContactGroup, WirelessLANGroup
2026-02-13 17:00:04 +01:00
Jeremy Stretch 712c743bcb
Closes #20954: Add indexes for GFKs (#21015) 2025-12-18 14:49:00 -08:00
Jeremy Stretch be74436884
Closes #20304: Object owners (#20634) 2025-10-24 13:08:01 -07:00
Jason Novinger a2a8779ebc
Fixes #19415: Increased Circuit/WirelessLink distance upper limit (#19495)
* Fixes #19415: Increased Circuit/WirelessLink absolute distance upper limit

Also adds form validation that provides a useful message to the user
rather than a 500 error with potentially little information.

* Include forgotten migration files

* Remove unnecessary comments

* Remove more unnecessary comments

* Addresses PR feedback

* Gah, remove django migration header comment

* Clean up new has_field_errors mechanism, fix issue with ObjectAttribute

* Address PR feedback, revert changes to render_fieldset template tag
2025-05-19 08:38:30 -04:00
Jeremy Stretch 76aa255f07 Fixes #19440: Ensure data migrations use the correct database connection 2025-05-08 14:53:52 -04:00
Jeremy Stretch d93d398afa Closes #17166: Remove obsolete limit_choices_to argument from ForeignKey & M2M fields 2025-04-03 09:17:20 -04:00
Jason Novinger b45e256f27 Removes banner from new migrations 2025-03-13 15:43:32 -05:00
Jason Novinger ae7a47ca60 Adds comments field to abstract NestedGroupModel and associated migrations
Models affected:
- dcim: `Location`, `Region`, `SiteGroup`
- tenancy`: `ContactGroup`, `TenantGroup`
- wireless: `WirelessLANGroup`
2025-03-13 11:52:06 -05:00
bctiemann bbf4eea76c
Fixes: #18808 - Fix incorrect dependencies on squashed migrations (#18827) 2025-03-07 10:20:34 -08:00
Jeremy Stretch 343a4af591
Closes #18022: Extend linter (ruff) to enforce line length limit (120 chars) (#18067)
* Enable E501 rule
* Configure ruff formatter
* Reformat migration files to fix line length violations
* Fix various E501 errors
* Move table template code to template_code.py & ignore E501 errors
* Reformat raw SQL
2024-11-21 15:58:11 -05:00
Arthur Hanson 9fe6685562
17929 Add Scope Mixins to Prefix (#17930)
* 17929 Add Scope Mixins to Prefix

* 17929 Add Scope Mixins to Prefix

* 17929 fixes for tests

* 17929 merge latest scope changes

* 12596 review changes

* 12596 review changes

* 12596 review changes

* 12596 review changes

* 12596 review changes

* 12596 review changes

* 17929 fix migrations
2024-11-15 14:55:46 -05:00
Arthur Hanson 6ab0792f02
Closes #11279: Replace `_name` natural key sorting with collation (#18009)
* 11279 add collation

* 11279 add collation

* 11279 add collation

* 11279 add collation

* 11279 fix tables /tests

* 11279 fix tests

* 11279 refactor VirtualDisk

* Clean up migrations

* Misc cleanup

* Correct errant file inclusion

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2024-11-15 09:32:09 -05:00
Arthur Hanson 812ce8471a
10711 Add Scope to WirelessLAN (#17877)
* 7699 Add Scope to Cluster

* 7699 Serializer

* 7699 filterset

* 7699 bulk_edit

* 7699 bulk_import

* 7699 model_form

* 7699 graphql, tables

* 7699 fixes

* 7699 fixes

* 7699 fixes

* 7699 fixes

* 7699 fix tests

* 7699 fix graphql tests for clusters reference

* 7699 fix dcim tests

* 7699 fix ipam tests

* 7699 fix tests

* 7699 use mixin for model

* 7699 change mixin name

* 7699 scope form

* 7699 scope form

* 7699 scoped form, fitlerset

* 7699 review changes

* 7699 move ScopedFilterset

* 7699 move CachedScopeMixin

* 7699 review changes

* 10711 Add Scope to WirelessLAN

* 10711 Add Scope to WirelessLAN

* 10711 Add Scope to WirelessLAN

* 10711 Add Scope to WirelessLAN

* 10711 Add Scope to WirelessLAN

* 7699 review changes

* 7699 refactor mixins

* 7699 _sitegroup -> _site_group

* 7699 update docstring

* fix model

* remove old constants, update filtersets

* 10711 fix GraphQL

* 10711 fix API

* 10711 add tests

* 10711 review changes

* 10711 add tests

* 10711 add scope to detail template

* 10711 add api test

* Extend CSV test data

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2024-11-07 10:28:02 -05:00
Jeremy Stretch ef1fdf0a01 Closes #17761: Store empty CharField choices as null 2024-10-21 13:12:05 -04:00
Arthur Hanson 91dcecbd07
15106 Add Length Field to Wireless Link (#16528)
* 15106 add wireles link length

* 15106 add wireles link length

* 15106 add wireless link length

* 15106 add tests

* 15106 rename length -> distance

* 15106 rename length -> distance

* 15106 review comments

* 15106 review comments

* 15106 fix form

* 15106 length -> distance
2024-06-17 09:19:49 -04:00
Jeremy Stretch b554e70eda Squash migrations 2024-01-25 12:35:04 -05:00
Jeremy Stretch 222388b988 Revert "Closes #13647: Squash all migrations prior to v3.7 (#14853)"
This reverts commit 874685fd6f.
2024-01-22 13:15:43 -05:00
Jeremy Stretch 874685fd6f
Closes #13647: Squash all migrations prior to v3.7 (#14853)
* Regenerate pre-v3.7 migrations

* Annotate replaced migrations

* Rename dependencies; remove FeatureQuery references

* Add missed replacement
2024-01-19 13:55:22 -05:00
jeremystretch ad40d42dc4 Closes #10710: Add status field to WirelessLAN 2022-11-04 13:40:39 -04:00
Jeremy Stretch bc6b5bc4be
Closes #10545: Standardize description & comment fields on primary models (#10834)
* Standardize description & comments fields on primary models

* Update REST API serializers

* Update forms

* Update tables

* Update templates
2022-11-04 08:28:09 -04:00
Arthur Hanson af8bb0c4b9
10348 add decimal custom field (#10422)
* 10348 add decimal custom field

* 10348 fix tests

* 10348 add documentation

* Rearrange custom fields to be ordered consistently

* Rename number_field to integer_field for clarity

* Clean up validation logic

* Apply suggested changes from PR

* Store decimal custom field values natively

* Fix filter test

* Update custom field model migrations to use new encoder

Co-authored-by: jeremystretch <jstretch@ns1.com>
2022-09-30 16:03:24 -04:00
jeremystretch f51415cf2c Replace unique_together with UniqueConstraints 2022-09-27 15:35:24 -04:00
jeremystretch f70ef7a585 Changelog and cleanup for #9935 2022-08-24 16:44:24 -04:00
Arthur Hanson eb2bf3469e
#9935 add new wireless choices for interfaces (#10116)
* #9935 add new wireless choices for interfaces

* #9935 add new wireless interfaces to constants

* #9935 oops - remove login.html changes
2022-08-24 16:36:38 -04:00
jeremystretch 7dd5f9e720 Closes #9177: Add tenant assignment for wireless LANs & links 2022-06-27 11:30:52 -04:00
jeremystretch c1b7f09530 Ensure legacy data checks run before other migrations 2022-04-05 15:56:21 -04:00
jeremystretch 272d6e7437 Closes #8463: Change the created field on all change-logged models from date to datetime 2022-02-08 14:41:44 -05:00
jeremystretch e4abbfb2c6 Closes #8454: Set DEFAULT_AUTO_FIELD to BigAutoField 2022-01-25 17:37:06 -05:00
jeremystretch 988383648c Fixes #8001: Correct verbose name for wireless LAN group model 2021-12-08 10:45:27 -05:00
jeremystretch 704fdf9ccd Optimize wireless migrations 2021-11-01 11:23:58 -04:00
jeremystretch 3a3ed8bf64 Merge branch 'feature' into 3979-wireless 2021-10-21 13:19:52 -04:00
jeremystretch a66501250e Add wireless authentication attributes 2021-10-20 10:58:15 -04:00
jeremystretch 6af5a884cd Merge branch 'feature' into 3979-wireless 2021-10-14 16:32:24 -04:00
jeremystretch 64dad7dbd2 Optimize migrations 2021-10-14 15:11:03 -04:00
jeremystretch 01f791a44e Add WirelessLANGroup model 2021-10-13 16:40:12 -04:00
jeremystretch 95ed07a95e Add status field to WirelessLink 2021-10-13 14:31:30 -04:00
jeremystretch 90e9f34494 Add WirelessLink model 2021-10-13 09:46:17 -04:00
jeremystretch 5271680483 Rename SSID model to WirelessLAN 2021-10-12 17:06:31 -04:00
jeremystretch 38f6d22d2d Enable attachment of wireless interfaces to SSIDs 2021-10-12 13:48:06 -04:00
jeremystretch 8b80b0c3df Introduce the wireless app and SSID model 2021-10-12 12:48:36 -04:00