Commit 7470e316 authored by Christos Stavrakakis's avatar Christos Stavrakakis
Browse files

cyclades: More verbose models representation

Make unicode method of VirtualMachine, Network and FloatingIP models more
verbose.
parent bc68f1e9
...@@ -395,7 +395,7 @@ class VirtualMachine(models.Model): ...@@ -395,7 +395,7 @@ class VirtualMachine(models.Model):
get_latest_by = 'created' get_latest_by = 'created'
def __unicode__(self): def __unicode__(self):
return str(self.id) return "<vm: %s>" % str(self.id)
# Error classes # Error classes
class InvalidBackendIdError(Exception): class InvalidBackendIdError(Exception):
...@@ -532,7 +532,7 @@ class Network(models.Model): ...@@ -532,7 +532,7 @@ class Network(models.Model):
objects = ForUpdateManager() objects = ForUpdateManager()
def __unicode__(self): def __unicode__(self):
return str(self.id) return "<Network: %s>" % str(self.id)
@property @property
def backend_id(self): def backend_id(self):
...@@ -739,7 +739,7 @@ class FloatingIP(models.Model): ...@@ -739,7 +739,7 @@ class FloatingIP(models.Model):
objects = ForUpdateManager() objects = ForUpdateManager()
def __unicode__(self): def __unicode__(self):
return "<%s@%s>" % (self.ipv4, self.network.id) return "<FIP: %s@%s>" % (self.ipv4, self.network.id)
def in_use(self): def in_use(self):
if self.machine is None: if self.machine is None:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment