本文整理汇总了Python中geonode.people.forms.PocForm.is_valid方法的典型用法代码示例。如果您正苦于以下问题:Python PocForm.is_valid方法的具体用法?Python PocForm.is_valid怎么用?Python PocForm.is_valid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类geonode.people.forms.PocForm
的用法示例。
在下文中一共展示了PocForm.is_valid方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: layer_change_poc
# 需要导入模块: from geonode.people.forms import PocForm [as 别名]
# 或者: from geonode.people.forms.PocForm import is_valid [as 别名]
def layer_change_poc(request, ids, template="layers/layer_change_poc.html"):
layers = Layer.objects.filter(id__in=ids.split("_"))
if request.method == "POST":
form = PocForm(request.POST)
if form.is_valid():
for layer in layers:
layer.poc = form.cleaned_data["contact"]
layer.save()
# Process the data in form.cleaned_data
# ...
# Redirect after POST
return HttpResponseRedirect("/admin/maps/layer")
else:
form = PocForm() # An unbound form
return render_to_response(template, RequestContext(request, {"layers": layers, "form": form}))
示例2: layer_change_poc
# 需要导入模块: from geonode.people.forms import PocForm [as 别名]
# 或者: from geonode.people.forms.PocForm import is_valid [as 别名]
def layer_change_poc(request, ids, template = 'layers/layer_change_poc.html'):
layers = Layer.objects.filter(id__in=ids.split('_'))
if request.method == 'POST':
form = PocForm(request.POST)
if form.is_valid():
for layer in layers:
layer.poc = form.cleaned_data['contact']
layer.save()
# Process the data in form.cleaned_data
# ...
return HttpResponseRedirect('/admin/maps/layer') # Redirect after POST
else:
form = PocForm() # An unbound form
return render_to_response(template, RequestContext(request,
{'layers': layers, 'form': form }))