mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-11 04:07:39 +03:00
same logic, more pythonic
This commit is contained in:
parent
bac6f1fcf4
commit
ff36cbe4ba
|
@ -92,7 +92,7 @@ def _get_fields(opts):
|
|||
|
||||
|
||||
def _get_to_field(field):
|
||||
return field.to_fields[0] if hasattr(field, 'to_fields') and field.to_fields else None
|
||||
return getattr(field, 'to_fields', None) and field.to_fields[0]
|
||||
|
||||
|
||||
def _get_forward_relationships(opts):
|
||||
|
|
Loading…
Reference in New Issue
Block a user