MCPcopy
hub / github.com/django/django / get_model_from_relation

Function get_model_from_relation

django/contrib/admin/utils.py:504–508  ·  view source on GitHub ↗
(field)

Source from the content-addressed store, hash-verified

502
503
504def get_model_from_relation(field):
505 if hasattr(field, "path_infos"):
506 return field.path_infos[-1].to_opts.model
507 else:
508 raise NotRelationField
509
510
511def reverse_field_path(model, path):

Callers 3

__init__Method · 0.90
reverse_field_pathFunction · 0.85
get_fields_from_pathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected