def add_label_dependencies(test):
 _log_or_execute(repr(test), test.dependency_labels.clear, subject='clear dependencies from')
 for label_name in test.dependencies.split(','):
  label_name = label_name.strip().lower()
  if (not label_name):
   continue
  try:
   label = models.Label.objects.get(name=label_name)
  except models.Label.DoesNotExist:
   log_dependency_not_found(label_name)
   continue
  _log_or_execute(repr(label), test.dependency_labels.add, label, subject=('add dependency to %s' % test.name))

def add_label_dependencies ( test ) : _log_or_execute ( repr ( test ) , test . dependency_labels . clear , subject = 'clear dependencies from' ) for label_name in test . dependencies . split ( ',' ) : label_name = label_name . strip ( ) . lower ( ) if ( not label_name ) : continue try : label = models . Label . objects . get ( name = label_name ) except models . Label . DoesNotExist : log_dependency_not_found ( label_name ) continue _log_or_execute ( repr ( label ) , test . dependency_labels . add , label , subject = ( 'add dependency to %s' % test . name ) )
add proper many-to-many relationships from dependencies field .