def remove_useless_attributes(field, db=False, indexes=False):
 keywords = USELESS_KEYWORDS[:]
 if db:
  keywords += USELESS_DB_KEYWORDS[:]
 if indexes:
  keywords += INDEX_KEYWORDS[:]
 if field:
  for name in keywords:
   if (name in field[2]):
    del field[2][name]
 return field

def remove_useless_attributes ( field , db = False , indexes = False ) : keywords = USELESS_KEYWORDS [ : ] if db : keywords += USELESS_DB_KEYWORDS [ : ] if indexes : keywords += INDEX_KEYWORDS [ : ] if field : for name in keywords : if ( name in field [ 2 ] ) : del field [ 2 ] [ name ] return field
removes useless attributes from the fields defn .