Update Instances to Count in Device-Type Template #2678

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

Originally created by @hSaria on GitHub (Jun 21, 2019).

Environment

  • Python version: 3.6.8
  • NetBox version: 2.6.0

The Jinja template should be updated to reflect the recent change of Instance_count to device_count on the Device-Type. It currently still shows Instances.

Steps to Reproduce

  1. Browse to netbox.example.com/dcim/device-types/ or netbox.example.com/dcim/device-types/. They both say Instances when referring to device_count.

Expected Behavior

It'll show Count, Device Count, or Devices, preferably the last one (it'll match the Platforms page).

Observed Behavior

It shows Instances.

Originally created by @hSaria on GitHub (Jun 21, 2019). ### Environment * Python version: 3.6.8 * NetBox version: 2.6.0 The Jinja template should be updated to reflect the recent change of `Instance_count` to `device_count` on the Device-Type. It currently still shows `Instances`. ### Steps to Reproduce 1. Browse to `netbox.example.com/dcim/device-types/` or `netbox.example.com/dcim/device-types/`. They both say `Instances` when referring to `device_count`. ### Expected Behavior It'll show `Count`, `Device Count`, or `Devices`, preferably the last one (it'll match the Platforms page). ### Observed Behavior It shows `Instances`.
adam closed this issue 2025-12-29 18:21:04 +01:00
Author
Owner

@hSaria commented on GitHub (Jun 21, 2019):

If I'm not mistaken, it needs to be updated in the following:

./netbox/dcim/tables.py
./netbox/templates/dcim/devicetype.html

And you might also want to update DEVICETYPE_INSTANCES_TEMPLATE, perhaps to DEVICETYPE_COUNT_TEMPLATE.

@hSaria commented on GitHub (Jun 21, 2019): If I'm not mistaken, it needs to be updated in the following: ``` ./netbox/dcim/tables.py ./netbox/templates/dcim/devicetype.html ``` And you might also want to update `DEVICETYPE_INSTANCES_TEMPLATE`, perhaps to `DEVICETYPE_COUNT_TEMPLATE`.
Author
Owner

@DanSheps commented on GitHub (Jun 24, 2019):

Personally, it doesn't bother me one way or the other. The instance_count property was renamed to device_count for consistency within the API (in my opinion).

However, I have a different preference:

I personally would actually prefer instance, instead of count. I look at it like this, such that a device is a sub of device_type, and each device would be an instance of device_type. Contrast that to things like sites, racks where they are containers for devices and don't directly correspond to devices in a meaningful way

@DanSheps commented on GitHub (Jun 24, 2019): Personally, it doesn't bother me one way or the other. The instance_count property was renamed to device_count for consistency within the API (in my opinion). However, I have a different preference: I personally would actually prefer instance, instead of count. I look at it like this, such that a device is a sub of device_type, and each device would be an instance of device_type. Contrast that to things like sites, racks where they are containers for devices and don't directly correspond to devices in a meaningful way
Author
Owner

@hSaria commented on GitHub (Jun 24, 2019):

Good point. I don’t mind either way. I just thought I’d mention it in case it was missed. If it wasn’t, feel free to close the issue.

On 24 Jun 2019, at 5:36 pm, Daniel Sheppard notifications@github.com wrote:

Personally, it doesn't bother me one way or the other. The instance_count property was renamed to device_count for consistency within the API (in my opinion).

However, I have a different preference:

I personally would actually prefer instance, instead of count. I look at it like this, such that a device is a sub of device_type, and each device would be an instance of device_type. Contrast that to things like sites, racks where they are containers for devices and don't directly correspond to devices in a


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@hSaria commented on GitHub (Jun 24, 2019): Good point. I don’t mind either way. I just thought I’d mention it in case it was missed. If it wasn’t, feel free to close the issue. > On 24 Jun 2019, at 5:36 pm, Daniel Sheppard <notifications@github.com> wrote: > > Personally, it doesn't bother me one way or the other. The instance_count property was renamed to device_count for consistency within the API (in my opinion). > > However, I have a different preference: > > I personally would actually prefer instance, instead of count. I look at it like this, such that a device is a sub of device_type, and each device would be an instance of device_type. Contrast that to things like sites, racks where they are containers for devices and don't directly correspond to devices in a > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub, or mute the thread.
Author
Owner

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

Yeah I'm fine leaving this as-is.

@jeremystretch commented on GitHub (Jun 24, 2019): Yeah I'm fine leaving this as-is.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#2678