コード例 #1
0
ファイル: permission.py プロジェクト: kelvin007/opman-django
def AddPermission(request):
    form = PermissionListForm(request.POST)
    if form.is_valid():
        form.save()
        return HttpResponseRedirect(reverse('listpermissionurl'))
    else:
        form = PermissionListForm()
    kwvars = {
        'form': form,
        'request': request,
    }
    return render_to_response('UserManage/permission.add.html', kwvars, RequestContext(request))
コード例 #2
0
ファイル: permission.py プロジェクト: yugongpeng/opman-django
def AddPermission(request):
    form = PermissionListForm(request.POST)
    if form.is_valid():
        form.save()
        return HttpResponseRedirect(reverse('listpermissionurl'))
    else:
        form = PermissionListForm()
    kwvars = {
        'form': form,
        'request': request,
    }
    return render_to_response('UserManage/permission.add.html', kwvars,
                              RequestContext(request))
コード例 #3
0
ファイル: permission.py プロジェクト: kelvin007/opman-django
def EditPermission(request, ID):
    iPermission = PermissonList.objects.get(id=ID)
    if request.method == "POST":
        form = PermissionListForm(request.POST, instance=iPermission)
        if form.is_valid():
            form.save()
            return HttpResponseRedirect(reverse("listpermissionurl"))
    else:
        form = PermissionListForm(instance=iPermission)
    kwvars = {
        'ID': ID,
        'form': form,
        'request': request,
    }
    return render_to_response('UserManage/permission.edit.html', kwvars, RequestContext(request))
コード例 #4
0
ファイル: permission.py プロジェクト: yugongpeng/opman-django
def EditPermission(request, ID):
    iPermission = PermissonList.objects.get(id=ID)
    if request.method == "POST":
        form = PermissionListForm(request.POST, instance=iPermission)
        if form.is_valid():
            form.save()
            return HttpResponseRedirect(reverse("listpermissionurl"))
    else:
        form = PermissionListForm(instance=iPermission)
    kwvars = {
        'ID': ID,
        'form': form,
        'request': request,
    }
    return render_to_response('UserManage/permission.edit.html', kwvars,
                              RequestContext(request))