def upgrade(request, url='http://web2py.com'):
    web2py_version = request.env.web2py_version
    gluon_parent = request.env.gluon_parent
    if not gluon_parent.endswith('/'):
        gluon_parent += '/'
    (check, version) = check_new_version(web2py_version,
                                         url + '/examples/default/version')
    if not check:
        return False, 'Already latest version'
    if os.path.exists(os.path.join(gluon_parent, 'web2py.exe')):
        version_type = 'win'
        destination = gluon_parent
        subfolder = 'web2py/'
    elif gluon_parent.endswith('/Contents/Resources/'):
        version_type = 'osx'
        destination = gluon_parent[:-len('/Contents/Resources/')]
        subfolder = 'web2py/web2py.app/'
    else:
        version_type = 'src'
        destination = gluon_parent
        subfolder = 'web2py/'

    full_url = url + '/examples/static/web2py_%s.zip' % version_type
    filename = abspath('web2py_%s_downloaded.zip' % version_type)
    try:
        write_file(filename, urllib.urlopen(full_url).read(), 'wb')
    except Exception, e:
        return False, e
    try:
        unzip(filename, destination, subfolder)
        return True, None
    except Exception, e:
        return False, e
Allows customization of the JSON data returned when a valid form submission occurs.
dataset/ETHPy150Open uwdata/termite-data-server/web2py/gluon/admin.py/upgrade--crossover with--dataset/ETHPy150Open pinax/pinax-teams/pinax/teams/views.py/TeamInviteView.get_form_success_data