'Return a model for the given host. It holds quite a bit of info.
It has 15 columns holding the host ID and name as parent,
all the information about the interfaces of that host and all the
information about the services of those interfaces.
The model is difficult to draw because of its nested nature, but
you can think of it like this, keeping in mind each node has
several columns
HOST
-----> INTERFACE1
------------> SERVICE1
------------> SERVICE2
-----> INTERFACE2
-----------> SERVICE1
-----------> SERVICE2
And so on and so on, like Zizek says.'

def create_model(self, host):

    model = Gtk.TreeStore(str, str, str, str, str, str, str, str, str, str, str, str, str)
    display_str = (((host.getName() + '    (') + str(len(host.getVulns()))) + ')')
    owned_status = ('Yes' if host.isOwned() else 'No')
    host_position = model.append(None, [host.getID(), host.getName(), host.getOS(), owned_status, str(len(host.getVulns())), '', '', '', '', '', '', '', display_str])
    def lst_to_str(lst):
        'Convenient    function    to    avoid    this    long    line    everywhere'
        return ',    '.join([str(word) for word in lst if word])
    def add_interface_to_host_in_model(interface, host_pos, model):
        'Append    an    interface    to    the    host    within    a    model.\n                                                Return    the    tree_iter    represeting    the    position    of    the    interface\n                                                within    the    model.    Modifies    the    model.\n                                                '
        ipv4_dic = interface.getIPv4()
        ipv6_dic = interface.getIPv6()
        display_str = str(interface)
        position = model.append(host_pos, [interface.getID(), interface.getName(), interface.getDescription(), interface.getMAC(), ipv4_dic['mask'], ipv4_dic['gateway'], lst_to_str(ipv4_dic['DNS']), ipv4_dic['address'], ipv6_dic['prefix'], ipv6_dic['gateway'], lst_to_str(ipv6_dic['DNS']), ipv6_dic['address'], display_str])
        return position
    def add_service_to_interface_in_model(service, interface_pos, model):
        'Append    a    service    to    an    interface    at    interface_pos    in    the    given\n                                                model.    Return    None.    Modifies    the    model'
        display_str = (((service.getName() + '    (') + str(len(service.getVulns()))) + ')')
        model.append(interface_pos, [service.getID(), service.getName(), service.getDescription(), service.getProtocol(), service.getStatus(), lst_to_str(service.getPorts()), service.getVersion(), ('Yes' if service.isOwned() else 'No'), '', '', '', '', display_str])
    interfaces = host.getAllInterfaces()
    for interface in interfaces:
        interface_position = add_interface_to_host_in_model(interface, host_position, model)
        services = interface.getAllServices()
        for service in services:
            add_service_to_interface_in_model(service, interface_position, model)
    return model
