- 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
Add a get_absolute_url() method on NetBoxModel to dynamically return the appropriate URL based on the model's app_label and model_name Meta attributes:
def get_absolute_url(self): return reverse(f'{self._meta.app_label}:{model_name}', args=[self.pk])Justification
The vast majority of models in NetBox declare this method explicitly. Moving it to NetBoxModel allows us to remove boilerplate code while still permitting customization on individual models.
DanSheps, cruse1977, peteeckel, alehaa and jsenecal
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