def get_field_parts(model, field_name):
 parts = field_name.split(LOOKUP_SEP)
 opts = model._meta
 fields = []
 for name in parts:
  try:
   field = opts.get_field(name)
  except FieldDoesNotExist:
   return None
  fields.append(field)
  if isinstance(field, RelatedField):
   opts = remote_model(field)._meta
  elif isinstance(field, ForeignObjectRel):
   opts = field.related_model._meta
 return fields

def get_field_parts ( model , field_name ) : parts = field_name . split ( LOOKUP_SEP ) opts = model . _meta fields = [ ] for name in parts : try : field = opts . get_field ( name ) except FieldDoesNotExist : return None fields . append ( field ) if isinstance ( field , RelatedField ) : opts = remote_model ( field ) . _meta elif isinstance ( field , ForeignObjectRel ) : opts = field . related_model . _meta return fields
get the field parts that represent the traversable relationships from the base model to the final field .