Beispiel #1
0
def upgrade_index(request):
    return HttpResponseRedirect("/account")
    """
    用户升级页面,不同级别看到的模板是不一样的
    每个user_type在ControTable里有一些元数据信息,交易限额,费率,账期等
    """
    user, level = request.user, request.user.user_level
    currentUserLevel = CoreLevel.objects.get(level=level)

    print currentUserLevel.monthamount

    # 不同账号级别用不同的页面显示
    templatePath = UPGRADE_PAGE_INDEX.get(u"LevelType_%s" % AccountType.get_level_type(level), None)
    if templatePath is None:
        raise Exception(u"没有获取到对应等级的升级页面,level:%s" % level)

    p = UserProxy.objects.get(pk=user.pk).get_xuser()
    context = {"person": p, "currentUserLevel": currentUserLevel, "can_upgrade": user_can_upgrade(request.user)}
    return render_to_response(templatePath, context, context_instance=RequestContext(request))