'Apply method.
@param r: the S3Request
@param attr: controller options for this request'

@staticmethod
def apply_method(r, **attr):

    if (r.representation == 'html'):
        T = current.T
        s3db = current.s3db
        response = current.response
        tracker = S3Trackable(r.table, record_id=r.id)
        title = T('Check-Out')
        formstyle = current.deployment_settings.get_ui_formstyle()
        row = formstyle('test', 'test', 'test', 'test')
        if isinstance(row, tuple):
            tuple_rows = True
        else:
            tuple_rows = False
        form_rows = []
        comment = ''
        _id = 'submit'
        label = ''
        widget = INPUT(_type='submit', _value=T('Check-Out'))
        row = formstyle(('%s__row' % _id), label, widget, comment)
        if tuple_rows:
            form_rows.append(row[0])
            form_rows.append(row[1])
        else:
            form_rows.append(row)
        if tuple_rows:
            form = FORM(TABLE(*form_rows))
        else:
            form = FORM(*form_rows)
        if form.accepts(current.request.vars, current.session):
            tracker.set_location(r.record.location_id)
            response.confirmation = T('Checked-Out    successfully!')
        response.view = 'check-in.html'
        output = dict(form=form, title=title)
        return output
    else:
        raise HTTP(415, current.ERROR.BAD_FORMAT)
