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

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

        def get_version_count(recipe_id, recipes):
    """ ?????????? ?????????? ?????? ??????? ? ???????? id
    """
    try:
        for curr_name, curr_id, versions in recipes:
            if curr_id == recipe_id:
                return len(versions)
    except Exception as e:
        logging.error(e)
        logging.error(cgitb.text(sys.exc_info()))
    return 0    
        


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
            return render_to_response('recipes.html', c)
        elif request.POST['action'] == u'Удалить':   
            if get_version_count(recipe_id, c['recipes']) <= 1: # это был последний рецепт в своем роде
                recipe_delete(recipe_id)
                return HttpResponseRedirect("/recipes")