@check_type(JSONModelObject)
def format_from_obj(obj, format_string):
    'Generates a human-readable string from an object.\n\n    :param JSONModelObject location: an ArchivesSpace object.\n\n    :returns: a string in the chosen format.\n    :rtype: str\n    '
    if (not format_string):
        raise Exception('No format string provided.')
    else:
        try:
            d = {}
            matches = [i[1] for i in Formatter().parse(format_string) if i[1]]
            for m in matches:
                d.update({m: getattr(obj, m, '')})
            return format_string.format(**d)
        except KeyError as e:
            raise KeyError('The field {} was not found in this object'.format(str(e)))
Generates a human-readable string from an object.

:param JSONModelObject location: an ArchivesSpace object.

:returns: a string in the chosen format.
:rtype: str
@check_type(JSONModelObject)
def format_from_obj(obj, format_string):
    'Generates a human-readable string from an object.\n\n    :param JSONModelObject location: an ArchivesSpace object.\n\n    :returns: a string in the chosen format.\n    :rtype: str\n    '
    if (not format_string):
        raise Exception('No format string provided.')
    else:
        try:
            d = {}
            matches = [i[1] for i in Formatter().parse(format_string) if i[1]]
            for m in matches:
                d.update({m: getattr(obj, m, )})
            return format_string.format(**d)
        except KeyError as e:
            raise KeyError('The field {} was not found in this object'.format(str(e)))