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

Added prefetching of tags to ViewSet classes for all objects #291

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

ccc2lu
Copy link

@ccc2lu ccc2lu commented Jan 17, 2025

Closes: #239

What's Changed

Tags are now included in the response to API requests for the nautobot_firewall_models objects. I had suggested the changes to support this in a comment on issue 239 previously and one of my suggestions was incorporated already - adding TaggedModelSerializerMixin to all the classes that inherit from NautobotModelSerializer in nautobot_firewall_models/api/serializers.py. However, the other half of the changes I described to support adding the tags in API responses wasn't added yet. This consists of adding '.prefetch_related("tags")' to the end of the "objects.all()" line in each of the corresponding ViewSet classes in nautobot_firewall_models/api/views.py. That's what is included in this PR.

To Do

None

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

Successfully merging this pull request may close these issues.

Tags missing from Object model via API
1 participant