Split line and added indentation for better readability.

This commit is contained in:
Aleksander Budzinski 2014-02-15 19:35:41 +01:00 committed by Tim Graham
parent 94b5bc361a
commit f46ef750b9
1 changed files with 4 additions and 2 deletions

View File

@ -268,8 +268,10 @@ def lookup_field(name, obj, model_admin=None):
if callable(name):
attr = name
value = attr(obj)
elif (model_admin is not None and hasattr(model_admin, name) and
not name == '__str__' and not name == '__unicode__'):
elif (model_admin is not None and
hasattr(model_admin, name) and
not name == '__str__' and
not name == '__unicode__'):
attr = getattr(model_admin, name)
value = attr(obj)
else: