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

Use ContactsMixin for Assets #162

Open
alehaa opened this issue Apr 28, 2024 · 2 comments
Open

Use ContactsMixin for Assets #162

alehaa opened this issue Apr 28, 2024 · 2 comments

Comments

@alehaa
Copy link
Contributor

alehaa commented Apr 28, 2024

Currently, an asset can only be assigned to one contact. In practice, however, an asset may have more than one contact, i.e. someone who is responsible for an asset and multiple users who have access to it. Thus, a contact-asset relationship can also have multiple types.

Therefore I ask to switch to the use of ContactsMixin, which has a consistent contact assignment as for the NetBox core models. This mixin class is not part of the official NetBox plugin API, but is already used in this plugin anyway, so there seems to be no overhead for maintenance.

NOTE: This feature request will result in an API breaking change, as an existing field will be removed. Also, it can't be migrated automatically, as required fields for contact mapping are currently missing and can't be determined automatically.

@matejv
Copy link
Member

matejv commented Jul 16, 2024

I agree this would make sense.

For migration I suppose we could create a ContactRole called something like InventoryAssetMigrated and use it for all existing asset contacts. Users can then go and rename this role or use bulk edit to assign a different one. Also role creation should only happen if any assets have contacts assigned at time of migration so we don't pollute ContactRoles if not needed...

Another breaking change is CSV import of assets. Currently import of assets can assign a contact as well (contact — name Contact using this asset. It must exist before import.). Also API will change.

@rizlas
Copy link
Contributor

rizlas commented Jul 17, 2024

Therefore I ask to switch to the use of ContactsMixin, which has a consistent contact assignment as for the NetBox core models.

I had the same thought during the development of #185 . Add a tab with contacts, and handle contacts via assignment, will be the same user experience as other NetBox core parts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants