def get_name_for_obj(obj):
    """Return a 'name' field for an object. Most objects have a field called `name`, so we try this first.
    If this fails, we try `reference` (for Datafiles) and `synonym` (for Synonyms), otherwise we just return
    'Unknown'.
    """
    if "name" in obj.__dict__:
        return obj.name
    elif "reference" in obj.__dict__:
        return obj.reference
    elif "synonym" in obj.__dict__:
        return obj.synonym
    else:
        return "Unknown"