Closed
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.