def get_fields_from_path(model, path):
 pieces = path.split(LOOKUP_SEP)
 fields = []
 for piece in pieces:
  if fields:
   parent = get_model_from_relation(fields[(-1)])
  else:
   parent = model
  fields.append(parent._meta.get_field(piece))
 return fields

def get_fields_from_path ( model , path ) : pieces = path . split ( LOOKUP_SEP ) fields = [ ] for piece in pieces : if fields : parent = get_model_from_relation ( fields [ ( - 1 ) ] ) else : parent = model fields . append ( parent . _meta . get_field ( piece ) ) return fields
return list of fields given path relative to model .