-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
status: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: housekeepingChanges to the application which do not directly impact the end userChanges to the application which do not directly impact the end user
Milestone
Description
Proposed Changes
Update models in NetBox to use a standardized name for ForeignKey fields to the ContentType model. The name object_type is most appropriate IMO. Applicable fields include:
- dcim.Cable
- termination_a_type
- termination_b_type
extras.CustomFieldobj_type
extras.CustomFieldValueobj_type
- extras.CustomLink
- content_type
- extras.ExportTemplate
- content_type
extras.Graphtype
- extras.ImageAttachment
- content_type
- extras.ObjectChange
- changed_object_type
- related_object_type
- extras.Webhook
- obj_type
- users.ObjectPermission
- content_types (v2.9)
The proposal here is to rename fields named type, obj_type, or content_type to object_type. The Cable and ObjectChange models likely need no changes.
Justification
- Standardizing on a common name readily conveys the purpose of the field.
object_typeis more accurate thancontent_typeand more apparent thanobj_type. (typealone should be avoided due to its status as a reserved word in Python.)
lampwins
Metadata
Metadata
Assignees
Labels
status: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: housekeepingChanges to the application which do not directly impact the end userChanges to the application which do not directly impact the end user