File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
cesnet_service_path_plugin/models Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 11from django .db import models
22from django .conf import settings
3+ from django .urls import reverse
34from netbox .models import NetBoxModel
45
56
@@ -48,6 +49,15 @@ class SegmentFinancialInfo(NetBoxModel):
4849
4950 notes = models .TextField (blank = True , help_text = "Additional financial notes" )
5051
52+ class Meta :
53+ ordering = ("segment" ,)
54+
55+ def __str__ (self ):
56+ return f"{ self .segment .name } - Financial Info"
57+
58+ def get_absolute_url (self ):
59+ return reverse ("plugins:cesnet_service_path_plugin:segmentfinancialinfo" , args = [self .pk ])
60+
5161 @property
5262 def total_commitment_cost (self ):
5363 """Calculate total cost over commitment period."""
@@ -64,6 +74,3 @@ def total_cost_including_setup(self):
6474 if self .non_recurring_charge :
6575 total += self .non_recurring_charge
6676 return total if total > 0 else None
67-
68- class Meta :
69- ordering = ("segment" ,)
You can’t perform that action at this time.
0 commit comments