def label_add_hosts(id, hosts):
 host_objs = models.Host.smart_get_bulk(hosts)
 label = models.Label.smart_get(id)
 if label.platform:
  models.Host.check_no_platform(host_objs)
 label.host_set.add(*host_objs)

def label_add_hosts ( id , hosts ) : host_objs = models . Host . smart_get_bulk ( hosts ) label = models . Label . smart_get ( id ) if label . platform : models . Host . check_no_platform ( host_objs ) label . host_set . add ( * host_objs )
add multiple hosts to a label .