Пример #1
0
def new_sale_opportunity(request):
    model_list = get_user_display_model(request.user.username)
    t = get_template('main_sale_opportunity_detail_new.html')
    customer_data = get_user_customer_name(request)
    html = t.render(Context(
        {'username': request.user.username,
         'title': "新建",
         'customer_data': customer_data,
         'model_list': model_list}
    ))
    return HttpResponse(html)
Пример #2
0
def edit_sale_opportunity(request):
    model_list = get_user_display_model(request.user.username)
    t = get_template('main_sale_opportunity_detail_edit.html')
    sale_opportunity_data = get_user_sale_opportunity_byid(request)
    #sale_opportunity_data.values()是一个list,list的每一项是一个dict
    #@todo:把所有从数据库取到数据放到一个"数据模型"里渲染
    customer_data = get_user_customer_name(request)
    html = t.render(Context(
        {'model_list': model_list,
         'title': "编辑",
         'customer_data': customer_data,
         'sale_opportunity_data':sale_opportunity_data.values()[0]
        }
    ))
    return HttpResponse(html)