-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Performance
Copy link
Labels
netboxstatus: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: performanceA concern regarding application performanceA concern regarding application performance
Milestone
Description
NetBox Version
v4.5.1
Python Version
3.12
Area(s) of Concern
- User Interface
- REST API
- GraphQL API
- Python ORM
- Other
Details
The to_internal_value() method of our custom ContentTypeField currently resolves the reference ContentType using get():
netbox/netbox/netbox/api/fields.py
Line 112 in 359179f
| return self.queryset.get(app_label=app_label, model=model) |
This should call the manager's get_by_natural_key() method instead, to leverage its built-in caching and avoid redundant queries.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
netboxstatus: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: performanceA concern regarding application performanceA concern regarding application performance