File diff 40cc47b13d9b → 744593ed423d
conntrackt/models.py
Show inline comments
 
@@ -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):
 
        """
 
        Produces string representation of communication that includes only the
 
        destination interface information.
 

	
 
        The method is useful where the source context is well known.
 

	
 
        Returns:
 
            Communication representation that includes only information about
 
            the destination interface.
 
        """
 

	
 
        return "%s - %s: %d" % (self.destination, self.protocol, self.port)