-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Standardize on naming for ContentType fields #4711
Comments
My view: Standardization is good, where we can get away with it. I know there are going to be places where we can (ObjectPermissions) but we can get close. I would be worried however about how many instances we call the object_type (or the others) directly. I don't think there is many but could be wrong. |
Thought about this some more. Seems fine to just change |
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:extras.CustomFieldobj_typeextras.CustomFieldValueobj_typeextras.GraphtypeThe proposal here is to rename fields named
type
,obj_type
, orcontent_type
toobject_type
. The Cable and ObjectChange models likely need no changes.Justification
object_type
is more accurate thancontent_type
and more apparent thanobj_type
. (type
alone should be avoided due to its status as a reserved word in Python.)The text was updated successfully, but these errors were encountered: