Ability to add custom fields to device templates and module templates #6967

Closed
opened 2025-12-29 19:47:17 +01:00 by adam · 9 comments
Owner

Originally created by @ghost on GitHub (Sep 12, 2022).

NetBox version

v3.3.2

Feature type

New functionality

Proposed functionality

When creating custom fields, they only appear when working inside a device or module, not the device type or module type.

Please add the ability to have custom fields be part of the device type and module type areas of netbox.

Based on : https://github.com/netbox-community/netbox/discussions/10293

Use case

Our use case would be to add a custom field to a power port. Then when that power port is added to any device the custom field is already populated.
Similar to how maximum draw and allocated draw would already be present when adding a power port to a type.

Currently, you would have to create the device, go to the power port for the device AFTER its created, click edit, and populate the custom field every time for every device.

Database changes

I'm unsure what kind of database requirements would be needed to add the ability for custom fields to show up on device type and module type pages.

External dependencies

None that I can see.

Originally created by @ghost on GitHub (Sep 12, 2022). ### NetBox version v3.3.2 ### Feature type New functionality ### Proposed functionality When creating custom fields, they only appear when working inside a device or module, not the device type or module type. Please add the ability to have custom fields be part of the device type and module type areas of netbox. Based on : https://github.com/netbox-community/netbox/discussions/10293 ### Use case Our use case would be to add a custom field to a power port. Then when that power port is added to any device the custom field is already populated. Similar to how maximum draw and allocated draw would already be present when adding a power port to a type. Currently, you would have to create the device, go to the power port for the device AFTER its created, click edit, and populate the custom field every time for every device. ### Database changes I'm unsure what kind of database requirements would be needed to add the ability for custom fields to show up on device type and module type pages. ### External dependencies None that I can see.
adam added the type: featurestatus: revisions needed labels 2025-12-29 19:47:17 +01:00
adam closed this issue 2025-12-29 19:47:17 +01:00
Author
Owner

@sleepinggenius2 commented on GitHub (Sep 21, 2022):

I asked for something similar in #9243 as well.

@sleepinggenius2 commented on GitHub (Sep 21, 2022): I asked for something similar in #9243 as well.
Author
Owner

@ghost commented on GitHub (Sep 22, 2022):

these look similar. Since multiple people are asking for similar functionality maybe it will get some traction.

@ghost commented on GitHub (Sep 22, 2022): these look similar. Since multiple people are asking for similar functionality maybe it will get some traction.
Author
Owner

@jsenecal commented on GitHub (Sep 22, 2022):

Can you add an example of custom field that would warrant such functionality ?

@jsenecal commented on GitHub (Sep 22, 2022): Can you add an example of custom field that would warrant such functionality ?
Author
Owner

@ghost commented on GitHub (Sep 22, 2022):

device
template
So let me describe my use case in more detail.

When you create a device template you can add 'power ports' to the template. When you add these power ports you are able to specify the maximum draw and allocated draw. Let's use easy numbers and say max draw is 100 watts, and allocated draw is 25 watts.

Now, when you create a new device from the device template that you just created the power ports are automatically added. And the max draw and allocated draw are already populated for you. Which is great! Now of course you can change these numbers per device if you so choose, but typically its unnecessary.

Now say we want to have a custom field on the power port. Currently, the custom field will only show up on the power port page when viewing a device. Not the device template. So if I wanted a custom field called 'BTU' that tracks the heat output of our power supplies I have to first create the device, then go to the power ports and fill in the BTU load for each device manually.

If the custom field 'BTU' were available on the device template, I could make the calculation and input the value just like I do for max draw and allocated draw. This way, when I create a new device from that device template, the BTU value is already filled out for me. Sure, I can change it if I need to (just like max draw), but the point is, the value is already filled in since its coming over from the device template.

@ghost commented on GitHub (Sep 22, 2022): ![device](https://user-images.githubusercontent.com/77940332/191647405-5b255fe0-cab4-4aa0-94a0-0ec7f8565789.PNG) ![template](https://user-images.githubusercontent.com/77940332/191647406-5e966f2a-cd89-4390-81f2-6791870eea07.PNG) So let me describe my use case in more detail. When you create a device template you can add 'power ports' to the template. When you add these power ports you are able to specify the maximum draw and allocated draw. Let's use easy numbers and say max draw is 100 watts, and allocated draw is 25 watts. Now, when you create a new device from the device template that you just created the power ports are automatically added. And the max draw and allocated draw are already populated for you. Which is great! Now of course you can change these numbers per device if you so choose, but typically its unnecessary. Now say we want to have a custom field on the power port. Currently, the custom field will only show up on the power port page when viewing a device. Not the device template. So if I wanted a custom field called 'BTU' that tracks the heat output of our power supplies I have to first create the device, then go to the power ports and fill in the BTU load for each device manually. If the custom field 'BTU' were available on the device template, I could make the calculation and input the value just like I do for max draw and allocated draw. This way, when I create a new device from that device template, the BTU value is already filled out for me. Sure, I can change it if I need to (just like max draw), but the point is, the value is already filled in since its coming over from the device template.
Author
Owner

@ghost commented on GitHub (Oct 4, 2022):

My last comment was deleted. So I'm not sure if I have satisfied the requirements of 'revisions needed'

@ghost commented on GitHub (Oct 4, 2022): My last comment was deleted. So I'm not sure if I have satisfied the requirements of 'revisions needed'
Author
Owner

@kkthxbye-code commented on GitHub (Oct 4, 2022):

Your previous comment was directly mentioning circumventing auto closure of the issue, which is explicitly against the rules.

In my opinion you still haven't explained how it should work in practice. Is it just matched by name the name of the field? What happens if customer field types do not match? In your FR you mention that it should be added to device and module types, but when you explain further you are referring component templates, is it both?

The proposal is still not very thorough in my opinion.

@kkthxbye-code commented on GitHub (Oct 4, 2022): Your previous comment was directly mentioning circumventing auto closure of the issue, which is explicitly against the rules. In my opinion you still haven't explained how it should work in practice. Is it just matched by name the name of the field? What happens if customer field types do not match? In your FR you mention that it should be added to device and module types, but when you explain further you are referring component templates, is it both? The proposal is still not very thorough in my opinion.
Author
Owner

@ghost commented on GitHub (Oct 4, 2022):

What are you talking about?
custom fields are not going to be different field types between a device and a device template. It's the same field. You just are able to select the device template page inside the model(s) selection

image

Currently, if you apply a custom field to the "DCIM > power port" model it will only show up on the device power port page after a device is created. You should also be able to apply this same custom field to the 'power port' of a device template.

@ghost commented on GitHub (Oct 4, 2022): What are you talking about? custom fields are not going to be different field types between a device and a device template. It's the same field. You just are able to select the device template page inside the model(s) selection ![image](https://user-images.githubusercontent.com/77940332/193854091-20828e52-447c-4948-a373-41687e108550.png) Currently, if you apply a custom field to the "DCIM > power port" model it will only show up on the device power port page after a device is created. You should also be able to apply this same custom field to the 'power port' of a device template.
Author
Owner

@kkthxbye-code commented on GitHub (Oct 4, 2022):

What are you talking about?

This is no way to talk. Locking this until we can figure out a way forward with regards to your agressive and hostile comments.

custom fields are not going to be different field types between a device and a device template

There's no such thing as a device template. There's device types and devices, both can have independant custom fields. Then there are device components and device component templates, where only the first ones can have custom fields.

@kkthxbye-code commented on GitHub (Oct 4, 2022): > What are you talking about? This is no way to talk. Locking this until we can figure out a way forward with regards to your agressive and hostile comments. > custom fields are not going to be different field types between a device and a device template There's no such thing as a device template. There's device types and devices, both can have independant custom fields. Then there are device components and device component templates, where only the first ones can have custom fields.
Author
Owner

@kkthxbye-code commented on GitHub (Oct 27, 2022):

Closing this as #9243 provides a much better description of the proposed feature.

@kkthxbye-code commented on GitHub (Oct 27, 2022): Closing this as #9243 provides a much better description of the proposed feature.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6967