

def _get_subclasses(model):
    subclasses = [model]
    for f in field._meta.get_all_field_names():
        field = model._meta.get_field_by_name(f)[0]
        if (isinstance(field, RelatedObject) and getattr(field.field.rel, 'parent_link', None)):
            subclasses.extend(_get_subclasses(field.model))
    return subclasses

dataset/ETHPy150Open lmorchard/badg.us/vendor-local/lib/python/taggit/managers.py _get_subclasses/VarMisuse@19/24 `model`->`field`