[PR #21004] [MERGED] Closes #20309: Add ASDOT notation support for ASN ranges #16120

Closed
opened 2025-12-30 00:25:54 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/21004
Author: @pheus
Created: 12/17/2025
Status: Merged
Merged: 12/22/2025
Merged by: @jeremystretch

Base: mainHead: 20309-add-asdot-notation-to-asn-ranges


📝 Commits (2)

  • 656c748 feat(ipam): Add ASDOT notation support for ASN ranges
  • e341498 Wrap "ASDOT" with parentheses in column header

📊 Changes

4 files changed (+72 additions, -17 deletions)

View changed files

📝 netbox/ipam/fields.py (+14 -0)
📝 netbox/ipam/models/asns.py (+45 -14)
📝 netbox/ipam/tables/asn.py (+12 -2)
📝 netbox/templates/ipam/asnrange.html (+1 -1)

📄 Description

Fixes: #20309

Introduces ASDOT notation for ASN ranges to improve readability of large AS numbers. Adds start_asdot and end_asdot properties, updates the relevant table columns, and adjusts display logic so ranges can show both ASPLAIN and ASDOT where appropriate.

Note

To avoid repeating the same ASDOT conversion logic (// 65536 / % 65536) in multiple places, the conversion is implemented once as ASNField.to_asdot() and reused by the model properties. This keeps the helper IPAM-scoped while ensuring consistent formatting across all ASN consumers.

I also reordered methods/properties in ASNRange to follow the common NetBox model style for readability. If maintainers would prefer the simpler (more repetitive) inline conversion and/or don’t want the reordering, I’m happy to adjust.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/21004 **Author:** [@pheus](https://github.com/pheus) **Created:** 12/17/2025 **Status:** ✅ Merged **Merged:** 12/22/2025 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `main` ← **Head:** `20309-add-asdot-notation-to-asn-ranges` --- ### 📝 Commits (2) - [`656c748`](https://github.com/netbox-community/netbox/commit/656c74836da335f91bf2b516569ad4342179a75b) feat(ipam): Add ASDOT notation support for ASN ranges - [`e341498`](https://github.com/netbox-community/netbox/commit/e341498af08d3112c9467520e9664c5ad71f0541) Wrap "ASDOT" with parentheses in column header ### 📊 Changes **4 files changed** (+72 additions, -17 deletions) <details> <summary>View changed files</summary> 📝 `netbox/ipam/fields.py` (+14 -0) 📝 `netbox/ipam/models/asns.py` (+45 -14) 📝 `netbox/ipam/tables/asn.py` (+12 -2) 📝 `netbox/templates/ipam/asnrange.html` (+1 -1) </details> ### 📄 Description <!-- Thank you for your interest in contributing to NetBox! Please note that our contribution policy requires that a feature request or bug report be approved and assigned prior to opening a pull request. This helps avoid waste time and effort on a proposed change that we might not be able to accept. IF YOUR PULL REQUEST DOES NOT REFERENCE AN ISSUE WHICH HAS BEEN ASSIGNED TO YOU, IT WILL BE CLOSED AUTOMATICALLY. Please specify your assigned issue number on the line below. --> ### Fixes: #20309 Introduces ASDOT notation for ASN ranges to improve readability of large AS numbers. Adds `start_asdot` and `end_asdot` properties, updates the relevant table columns, and adjusts display logic so ranges can show both ASPLAIN and ASDOT where appropriate. #### Note To avoid repeating the same ASDOT conversion logic (`// 65536` / `% 65536`) in multiple places, the conversion is implemented once as `ASNField.to_asdot()` and reused by the model properties. This keeps the helper IPAM-scoped while ensuring consistent formatting across all ASN consumers. I also reordered methods/properties in `ASNRange` to follow the common NetBox model style for readability. If maintainers would prefer the simpler (more repetitive) inline conversion and/or don’t want the reordering, I’m happy to adjust. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-30 00:25:54 +01:00
adam closed this issue 2025-12-30 00:25:54 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#16120