Skip to content

Commit

Permalink
refactor(model): better string representation
Browse files Browse the repository at this point in the history
  • Loading branch information
kpetremann committed Aug 8, 2024
1 parent c701582 commit 9bd00e9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion netbox_cmdb/netbox_cmdb/models/route_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class RoutePolicy(ChangeLoggedModel):
objects = RestrictedQuerySet.as_manager()

def __str__(self):
return str(self.name)
return f"{self.device}-{self.name}"

def __repr__(self):
return str(self.name)
Expand Down
2 changes: 1 addition & 1 deletion netbox_cmdb/netbox_cmdb/models/snmp.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ class Meta:
verbose_name_plural = "SNMP"

def __str__(self):
return f"SNMP configuration of {self.device.name}"
return f"{self.device.name}-SNMP"

0 comments on commit 9bd00e9

Please sign in to comment.