Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(6)  |  Call(5)  |  Derive(0)  |  Import(1)
?????????? ????? ????????? ?????? ??? ??????? ? ???????? id
    

        def get_last_version(recipe_id, recipes):
    """ ?????????? ????? ????????? ?????? ??? ??????? ? ???????? id
    """
    try:
        for curr_name, curr_id, versions in recipes:
            if curr_id == recipe_id:
                max_version = 0
                for v in versions:
                    if int(v['name']) > max_version:
                        max_version = int(v['name'])
                return max_version
    except Exception as e:
        logging.error(e)
        logging.error(cgitb.text(sys.exc_info()))
    return None
        


src/j/u/junta-0.2.22/server/views.py   junta(Download)
    from backend.servertoagent import installation_request, exit_request
    from backend.server import start_server
    from backend.recipes import get_recipes, get_recipe_template, get_next_version, \
                        not_valid_error_message, create_recipe_path_if_not_exists, recipe_save, get_recipe_content, \
                        get_last_version, get_default_config, delete_recipe_version, recipe_delete, get_version_count
def installation_begin(c, recipe_id, server_id):
    """ Начало установки, запрос конфигов
    """
    try:        
        c['config'] = get_default_config(recipe_id, get_last_version(recipe_id, c['recipes']))
        recipe_id = request.POST['recipe_id']
        recipe_name = get_recipe_name(recipe_id)
        recipe_version = get_last_version(recipe_id, c['recipes'])
        c.update(get_server_context(server_id))
 
                        recipe_id = key[8:]
                servers = request.POST.getlist('servers_to_install')
                c['config'] = get_default_config(recipe_id, get_last_version(recipe_id, c['recipes']))
                c['recipe_id'] = recipe_id
                c['servers_to_install'] = servers
                c['is_installation'] = True
            elif action == u'Готово':
                recipe_id = request.POST['recipe_id']
                servers = eval(request.POST['servers_to_install'])
                recipe_version = get_last_version(recipe_id, c['recipes'])