@@ -301,3 +301,31 @@ class Communication(models.Model):
"""
return "Edit"
def source_representation(self):
Produces string representation of communication that includes only the
source interface information.
The method is useful where the destination context is well known.
Returns:
Communication representation that includes only information about
the source interface.
return "%s - %s: %d" % (self.source, self.protocol, self.port)
def destination_representation(self):
destination interface information.
The method is useful where the source context is well known.
the destination interface.
return "%s - %s: %d" % (self.destination, self.protocol, self.port)