kopia lustrzana https://github.com/wagtail/wagtail
Cleanup usage of get_field_by_name in api
rodzic
381bd10665
commit
e12d301331
|
@ -63,7 +63,7 @@ def get_api_data(obj, fields):
|
|||
|
||||
# Check django fields
|
||||
try:
|
||||
field = obj._meta.get_field_by_name(field_name)[0]
|
||||
field = obj._meta.get_field(field_name)
|
||||
|
||||
if field.rel and isinstance(field.rel, models.ManyToOneRel):
|
||||
# Foreign key
|
||||
|
|
Ładowanie…
Reference in New Issue