@get_pid_or_default(default_value=dict())
def document_resolver(loan_pid):
    'Resolve a Document given a Loan PID.'
    Loan = current_circulation.loan_record_cls
    try:
        document_pid = get_field_value(Loan, loan_pid, 'document_pid')
    except KeyError:
        return {}
    Document = current_app_ils.document_record_cls
    try:
        document = Document.get_record_by_pid(document_pid)
    except PIDDeletedError:
        obj = {}
    else:
        obj = pick(document, 'authors', 'edition', 'document_type', 'pid', 'title')
    return obj
Resolve a Document given a Loan PID.
@get_pid_or_default(default_value=dict())
def document_resolver(loan_pid):
    
    Loan = current_circulation.loan_record_cls
    try:
        document_pid = get_field_value(Loan, loan_pid, 'document_pid')
    except KeyError:
        return {}
    Document = current_app_ils.document_record_cls
    try:
        document = Document.get_record_by_pid(document_pid)
    except PIDDeletedError:
        obj = {}
    else:
        obj = pick(document, 'authors', 'edition', 'document_type', 'pid', 'title')
    return obj