def string_to_list(string):
 args = []
 if string:
  string = str(string)
  if (',' not in string):
   string += ','
  for arg in string.split(','):
   arg = arg.strip()
   if (arg == ''):
    continue
   args.append(arg)
 return args

def string_to_list ( string ) : args = [ ] if string : string = str ( string ) if ( ',' not in string ) : string += ',' for arg in string . split ( ',' ) : arg = arg . strip ( ) if ( arg == '' ) : continue args . append ( arg ) return args
usage: {{ url|thumbnail:"width .