'Get the widgets for the request'

def __get_request_widgets(self, trans, id):

    request = trans.sa_session.query(trans.model.Request).get(id)
    request_widgets = []
    for (index, field) in enumerate(request.type.request_form.fields):
        field_value = request.values.content[field['name']]
        if field['required']:
            required_label = 'Required'
        else:
            required_label = 'Optional'
        if (field['type'] == 'AddressField'):
            if field_value:
                request_widgets.append(dict(label=field['label'], value=trans.sa_session.query(trans.model.UserAddress).get(int(field_value)).get_html(), helptext=(((field['helptext'] + '    (') + required_label) + ')')))
            else:
                request_widgets.append(dict(label=field['label'], value=None, helptext=(((field['helptext'] + '    (') + required_label) + ')')))
        else:
            request_widgets.append(dict(label=field['label'], value=field_value, helptext=(((field['helptext'] + '    (') + required_label) + ')')))
    return request_widgets
