Skip to content

ConfigContext optimization from #4559 not active for REST API views #5486

@jeremystretch

Description

@jeremystretch

Environment

  • Python version: 3.6.9
  • NetBox version: 2.10.1

Steps to Reproduce

  1. With debug enabled, make a REST API call for /api/dcim/devices/ and inspect the SQL queries being made.

Expected Behavior

Retrieval of ConfigContext data should be optimized per #4559.

Observed Behavior

ConfigContextQuerySetMixin's get_queryset() method is not called because DeviceViewSet inherits first from CustomFieldModelViewSet, which already provides get_queryset() (from the base ViewSet class).

Reversing the order of these parent classes ensures that the optimization provided by ConfigContextQuerySetMixin takes effect.

Metadata

Metadata

Assignees

Labels

status: acceptedThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the application

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions