network.links and sliver.ports are now reverse_name aliases for networksliver
diff --git a/xos/core/models/network.py b/xos/core/models/network.py
index d9a7d51..b7f6f3d 100644
--- a/xos/core/models/network.py
+++ b/xos/core/models/network.py
@@ -123,6 +123,11 @@
def __unicode__(self): return u'%s' % (self.name)
+ # TODO: Remove when NetworkSliver->Port rename is complete
+ @property
+ def links(self):
+ return self.networkslivers
+
def save(self, *args, **kwds):
if (not self.subnet) and (NO_OBSERVER):
from util.network_subnet_allocator import find_unused_subnet
@@ -210,8 +215,8 @@
# Please use "Port" instead of "NetworkSliver". NetworkSliver will soon be
# removed.
- network = models.ForeignKey(Network,related_name='networkslivers')
- sliver = models.ForeignKey(Sliver, null=True, blank=True, related_name='networkslivers')
+ network = models.ForeignKey(Network,related_name='networkslivers') # related_name='links'
+ sliver = models.ForeignKey(Sliver, null=True, blank=True, related_name='networkslivers') # related_name='ports'
ip = models.GenericIPAddressField(help_text="Sliver ip address", blank=True, null=True)
port_id = models.CharField(null=True, blank=True, max_length=256, help_text="Quantum port id")
diff --git a/xos/core/models/sliver.py b/xos/core/models/sliver.py
index 7df125e..d9185e1 100644
--- a/xos/core/models/sliver.py
+++ b/xos/core/models/sliver.py
@@ -98,6 +98,11 @@
tags = generic.GenericRelation(Tag)
userData = models.TextField(blank=True, null=True, help_text="user_data passed to instance during creation")
+ # TODO: Remove when NetworkSliver->Port rename is complete
+ @property
+ def ports(self):
+ return self.networkslivers
+
def __unicode__(self):
if self.name and Slice.objects.filter(id=self.slice_id) and (self.name != self.slice.name):
# NOTE: The weird check on self.slice_id was due to a problem when