Look for _get_parent_attribute method in both src and dst dict

When determining which getter style to use for the object in question,
the BaseMeta class should look at both dict's to try and locate the method.

Fixes #18522
pull/18530/head
James Cammarata 8 years ago
parent 4a325b5ea2
commit 4859e0a419

@ -111,7 +111,7 @@ class BaseMeta(type):
method = "_get_attr_%s" % attr_name
if method in src_dict or method in dst_dict:
getter = partial(_generic_g_method, attr_name)
elif '_get_parent_attribute' in dst_dict and value.inherit:
elif ('_get_parent_attribute' in dst_dict or '_get_parent_attribute' in src_dict) and value.inherit:
getter = partial(_generic_g_parent, attr_name)
else:
getter = partial(_generic_g, attr_name)

Loading…
Cancel
Save