Adding ConfigContext to DeviceType #2706

Closed
opened 2025-12-29 18:21:12 +01:00 by adam · 2 comments
Owner

Originally created by @sconwayubb on GitHub (Jun 28, 2019).

Environment

  • Python version: 3.5.2
  • NetBox version: 2.6.1

Proposed Functionality

Please add ConfigContext to DeviceType that would appear in the nested Device.config_context.

Use Case

Often there are certain models of equipment that have certain attributes that apply to all devices of that model but not necessarily to all of that Platform/Role. Adding ConfigContext will allow that information to be accessible when querying for a list of Devices without additional API calls to get Custom Field data for each type.

Database Changes

class ConfigContext(models.Model):
...
    device_types = models.ManyToManyField(
        to='dcim.DeviceType',
        related_name='+',
        blank=True
    )

External Dependencies

None.

Originally created by @sconwayubb on GitHub (Jun 28, 2019). ### Environment * Python version: 3.5.2 * NetBox version: 2.6.1 <!-- Describe in detail the new functionality you are proposing. Include any specific changes to work flows, data models, or the user interface. --> ### Proposed Functionality Please add ConfigContext to DeviceType that would appear in the nested Device.config_context. ### Use Case Often there are certain models of equipment that have certain attributes that apply to all devices of that model but not necessarily to all of that Platform/Role. Adding ConfigContext will allow that information to be accessible when querying for a list of Devices without additional API calls to get Custom Field data for each type. ### Database Changes ``` class ConfigContext(models.Model): ... device_types = models.ManyToManyField( to='dcim.DeviceType', related_name='+', blank=True ) ``` ### External Dependencies None.
adam closed this issue 2025-12-29 18:21:12 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jun 28, 2019):

Device types define physical hardware. Config context data has no relevance to them.

@jeremystretch commented on GitHub (Jun 28, 2019): Device types define physical hardware. Config context data has no relevance to them.
Author
Owner

@sconwayubb commented on GitHub (Jun 28, 2019):

If that's the case, then can Custom Fields be exposed on the Device list API?

@sconwayubb commented on GitHub (Jun 28, 2019): If that's the case, then can Custom Fields be exposed on the Device list API?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#2706