本文整理汇总了Python中geonode.people.forms.PocForm类的典型用法代码示例。如果您正苦于以下问题:Python PocForm类的具体用法?Python PocForm怎么用?Python PocForm使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PocForm类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: layer_change_poc
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
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 }))