-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Inconsistency in API for field role/device #6391
Comments
It doesn't seem like the hassle of introducing a breaking change like this would be worthwhile just to achieve consistency with another model. |
Of course it's a breaking change. On the other hand it means extra handling for every code that works with both devices and VMs. For example if you want to generate monitoring config from it. I understand that it is to much for a normal release but maybe if there is a future release with other braking changes it would be an opportunity to fix it. It would be the first braking change on the API (I remember fixing some code because of a change in the |
These are always going to require separate logic, as they are different models. Renaming the |
Flagging this for milestone assignment to potentially handle in the future. We could potentially implement a getter & setter to maintain backward compatibility across releases, however I'm not sure what potential pitfalls we'd run into regarding Django's ORM's behavior. |
Would it fine if a field is renamed and this is introduced as a breaking change for v3.5? I can submit a PR if that's accepted as a solution |
This could be a good candidate for 3.6 |
I'm going to try to make the field backward-compaitible for the API and ORM access. If that's possible, should be able to ship this with v3.6 |
* replaces device_role with role on device model #6391 * fixes lint issue #6391 * revert the database user * revert test_runner comment * changes as per review * Update references to device_role column in UserConfigs --------- Co-authored-by: Jeremy Stretch <[email protected]>
NetBox version
v2.9.9
Python version
3.6
Steps to Reproduce
role
device_role
Expected Behavior
I would expect that both fields are called the same (
role
) because they are linking to the same data.Observed Behavior
The device field is called
device_role
and the VM field is calledrole
The text was updated successfully, but these errors were encountered: