def save_step_range(request, property_id): """Save the steps of the property with given id. """ property = get_object_or_404(Property, pk=property_id) form = StepRangeForm(instance=property, data=request.POST) property = form.save() result = simplejson.dumps({ "message": _(u"Step range has been saved."), }, cls=LazyEncoder) return HttpResponse(result)
def save_step_range(request, property_id): """Save the steps of the property with given id. """ property = get_object_or_404(Property, pk=property_id) form = StepRangeForm(instance=property, data=request.POST) property = form.save() # invalidate global properties version number (all product property caches will be invalidated) invalidate_cache_group_id('global-properties-version') result = simplejson.dumps({ "message": _(u"Step range has been saved."), }, cls=LazyEncoder) return HttpResponse(result)
def save_step_range(request, property_id): """Save the steps of the property with given id. """ property = get_object_or_404(Property, pk=property_id) form = StepRangeForm(instance=property, data=request.POST) property = form.save() # invalidate global properties version number (all product property caches will be invalidated) invalidate_cache_group_id('global-properties-version') result = json.dumps({ "message": _(u"Step range has been saved."), }, cls=LazyEncoder) return HttpResponse(result, content_type='application/json')
def steps_inline(request, property_id, template_name="manage/properties/step_inline.html"): """Display the steps of a property. Factored out for Ajax requests. """ property = get_object_or_404(Property, pk=property_id) step_form = StepRangeForm(instance=property) step_type_form = StepTypeForm(instance=property) return render_to_string(template_name, RequestContext(request, { "property": property, "step_form": step_form, "step_type_form": step_type_form, }))