Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom fields on more models #3083

Closed
candlerb opened this issue Apr 18, 2019 · 2 comments
Closed

Custom fields on more models #3083

candlerb opened this issue Apr 18, 2019 · 2 comments

Comments

@candlerb
Copy link
Contributor

candlerb commented Apr 18, 2019

Environment

  • Python version: 3.5.2
  • NetBox version: 2.5.10

Proposed Functionality

Allow custom fields to be added to:

  • dcim_devicerole
  • dcim_inventoryitem

Use Case

On dcim_devicerole: add contact details for responsible team

On dcim_inventoryitem: add purchase date, warranty expiry, usage (e.g. OS disk / data disk), capacity, form factor (2.5"/3.5")

Database Changes

None that I can see: extras_customfield can link to any django_content_type.

External Dependencies

None

@jeremystretch
Copy link
Member

Custom fields are only supported on primary models for performance reasons. The FAQ offers more context on this.

@paravoid
Copy link
Contributor

Would it perhaps meaningful to use a JSONField (PostgreSQL's jsonb) instead for those cases? It would allow for reading these without extra queries (and thus show up in the listing), as well as searches in them. On the flip side I suppose it would make validation and multiple-choices fields more difficult.

I came across this task while looking on how to add a couple of our custom fields (e.g. ticket number) to inventory items like Juniper linecards.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants