Read Only Interface Custom Fields #3625

Closed
opened 2025-12-29 18:30:15 +01:00 by adam · 1 comment
Owner

Originally created by @nerdbaggy on GitHub (Apr 30, 2020).

Environment

  • Python version: 3.6.5
  • NetBox version: 2.8.1

Proposed Functionality

It would be great to have a field as a custom field to be ready only in the web interface, but not the API. Like in the Django Admin the

readonly_fields = []

https://docs.djangoproject.com/en/3.0/ref/contrib/admin/#django.contrib.admin.ModelAdmin.readonly_fields

Use Case

We integrate a lot of things into netbox, like our RDNS stuff. Have a field that a user can't change that we can put things like the RDNS record, its A record, if its been synced, things like that. We don't want the users/admin to be able to change them. Its all done via API calls.

Database Changes

The only change I can think of is a field on the custom fields model that is like is_readonly = True/False default False

External Dependencies

None

Originally created by @nerdbaggy on GitHub (Apr 30, 2020). ### Environment * Python version: 3.6.5 * NetBox version: 2.8.1 ### Proposed Functionality It would be great to have a field as a custom field to be ready only in the web interface, but not the API. Like in the Django Admin the ``` readonly_fields = [] ``` https://docs.djangoproject.com/en/3.0/ref/contrib/admin/#django.contrib.admin.ModelAdmin.readonly_fields ### Use Case We integrate a lot of things into netbox, like our RDNS stuff. Have a field that a user can't change that we can put things like the RDNS record, its A record, if its been synced, things like that. We don't want the users/admin to be able to change them. Its all done via API calls. ### Database Changes The only change I can think of is a field on the custom fields model that is like is_readonly = True/False default False ### External Dependencies None
adam closed this issue 2025-12-29 18:30:15 +01:00
Author
Owner

@jeremystretch commented on GitHub (Apr 30, 2020):

The REST API and web interface are intended to have parity. (I realize that is not currently the case, however it is a long-term design goal.) Thus, it would not make sense to enforce different validation logic for the two interfaces.

@jeremystretch commented on GitHub (Apr 30, 2020): The REST API and web interface are intended to have parity. (I realize that is not currently the case, however it is a long-term design goal.) Thus, it would not make sense to enforce different validation logic for the two interfaces.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3625