fuyi
6/21/2018 - 8:00 AM

limetypecheck.py

def _check_relational_existence(list_of_values):
  try:
    limetype = self.application.limetypes.get_limetype(list_of_values[0]) # Get limetype of first element
  except ValueError:
    print('Bad limetype provided')
   
  is_relation = limetype.is_relation()
  
  if len(list_of_values) == 1:
    if is_relation:
      raise ValueError('Search to end, no limetype found')
    else:
      return true
  else: # more element to process
    if is_relation:
      return _check_relational_existence(list_of_values[1:])
    else:
      raise ValueError('Limetype found in the middle of the string')