示例#1
0
文件: api.py 项目: palankai/xadrpy
def edit_group(request, group_id):
    group = get_object_or_404(Group, pk=group_id)
    form = GroupForm(request.POST, instance=group)
    if not form.is_valid():
        raise FormException(form)
    form.save()
示例#2
0
文件: api.py 项目: palankai/xadrpy
def add_group(request):
    form = GroupForm(request.POST)
    if not form.is_valid():
        raise FormException(form)
    form.save()