gave VOLTDevice and AccessAgent names
diff --git a/xos/services/cord/admin.py b/xos/services/cord/admin.py
index ccca02d..f9a41fe 100644
--- a/xos/services/cord/admin.py
+++ b/xos/services/cord/admin.py
@@ -112,9 +112,9 @@
# return "admin:cord_volttenant_change"
class VOLTDeviceAdmin(ReadOnlyAwareAdmin):
- list_display = ('backend_status_icon', 'openflow_id', 'driver' )
- list_display_links = ('backend_status_icon', 'openflow_id')
- fieldsets = [ (None, {'fields': ['backend_status_text','volt_service','openflow_id','driver','access_agent'],
+ list_display = ('backend_status_icon', 'name', 'openflow_id', 'driver' )
+ list_display_links = ('backend_status_icon', 'name', 'openflow_id')
+ fieldsets = [ (None, {'fields': ['backend_status_text','name','volt_service','openflow_id','driver','access_agent'],
'classes':['suit-tab suit-tab-general']})]
readonly_fields = ('backend_status_text',)
inlines = [AccessDeviceInline]
@@ -143,9 +143,9 @@
# return "admin:cord_volttenant_change"
class AccessAgentAdmin(ReadOnlyAwareAdmin):
- list_display = ('backend_status_icon', 'id', 'mac' )
- list_display_links = ('backend_status_icon', 'id')
- fieldsets = [ (None, {'fields': ['backend_status_text','volt_service','mac'],
+ list_display = ('backend_status_icon', 'name', 'mac' )
+ list_display_links = ('backend_status_icon', 'name')
+ fieldsets = [ (None, {'fields': ['backend_status_text','name','volt_service','mac'],
'classes':['suit-tab suit-tab-general']})]
readonly_fields = ('backend_status_text',)
inlines= [AgentPortMappingInline]
diff --git a/xos/services/cord/models.py b/xos/services/cord/models.py
index acb8a0d..35dc0ad 100644
--- a/xos/services/cord/models.py
+++ b/xos/services/cord/models.py
@@ -324,12 +324,13 @@
class Meta:
app_label = "cord"
+ name = models.CharField(max_length=254, help_text="name of device", null=False, blank=False)
volt_service = models.ForeignKey(VOLTService, related_name='volt_devices')
openflow_id = models.CharField(max_length=254, help_text="OpenFlow ID", null=True, blank=True)
driver = models.CharField(max_length=254, help_text="driver", null=True, blank=True)
access_agent = models.ForeignKey("AccessAgent", related_name='volt_devices', blank=True, null=True)
- def __unicode__(self): return u'%s' % (self.openflow_id)
+ def __unicode__(self): return u'%s' % (self.name)
class AccessDevice(PlCoreBase):
class Meta:
@@ -339,16 +340,17 @@
uplink = models.IntegerField(null=True, blank=True)
vlan = models.IntegerField(null=True, blank=True)
- def __unicode__(self): return u'%d:%d' % (self.uplink,self.vlan)
+ def __unicode__(self): return u'%s-%d:%d' % (self.volt_device.name,self.uplink,self.vlan)
class AccessAgent(PlCoreBase):
class Meta:
app_label = "cord"
+ name = models.CharField(max_length=254, help_text="name of agent", null=False, blank=False)
volt_service = models.ForeignKey(VOLTService, related_name='access_agents')
mac = models.CharField(max_length=32, help_text="MAC Address or Access Agent", null=True, blank=True)
- def __unicode__(self): return u'%s' % (self.mac)
+ def __unicode__(self): return u'%s' % (self.name)
class AgentPortMapping(PlCoreBase):
class Meta:
@@ -358,6 +360,8 @@
mac = models.CharField(max_length=32, help_text="MAC Address", null=True, blank=True)
port = models.CharField(max_length=32, help_text="Openflow port ID", null=True, blank=True)
+ def __unicode__(self): return u'%s-%s-%s' % (self.access_agent.name, self.port, self.mac)
+
# -------------------------------------------
# VCPE