Commit abc7ebe2 authored by Janez K's avatar Janez K
Browse files

popravil bug ko se niso prikazovali inputi in outputi

parent cb8f6b66
...@@ -142,6 +142,8 @@ def add_widget(request): ...@@ -142,6 +142,8 @@ def add_widget(request):
outputOrder += 1 outputOrder += 1
j.order = outputOrder j.order = outputOrder
j.save() j.save()
w.defered_outputs = w.outputs.defer("value").all()
w.defered_inputs = w.inputs.defer("value").all()
return render(request, 'widgets.html', {'widgets':[w,]}) return render(request, 'widgets.html', {'widgets':[w,]})
else: else:
return HttpResponse(status=400) return HttpResponse(status=400)
...@@ -188,6 +190,8 @@ def add_widget(request): ...@@ -188,6 +190,8 @@ def add_widget(request):
j.variable = i.variable j.variable = i.variable
j.widget = w j.widget = w
j.save() j.save()
w.defered_outputs = w.outputs.defer("value").all()
w.defered_inputs = w.inputs.defer("value").all()
return render(request, 'widgets.html', {'widgets':[w,]}) return render(request, 'widgets.html', {'widgets':[w,]})
elif aw.type=='subprocess': elif aw.type=='subprocess':
workflow = get_object_or_404(Workflow, pk=request.POST['active_workflow']) workflow = get_object_or_404(Workflow, pk=request.POST['active_workflow'])
...@@ -237,6 +241,8 @@ def add_widget(request): ...@@ -237,6 +241,8 @@ def add_widget(request):
j.save() j.save()
output_conversion[i.pk]=j.pk output_conversion[i.pk]=j.pk
workflows.models.copy_workflow(aw.workflow_link, request.user, widget_conversion,input_conversion,output_conversion,w) workflows.models.copy_workflow(aw.workflow_link, request.user, widget_conversion,input_conversion,output_conversion,w)
w.defered_outputs = w.outputs.defer("value").all()
w.defered_inputs = w.inputs.defer("value").all()
return render(request, 'widgets.html', {'widgets':[w,]}) return render(request, 'widgets.html', {'widgets':[w,]})
else: else:
return HttpResponse(status=400) return HttpResponse(status=400)
...@@ -393,6 +399,8 @@ def add_subprocess(request): ...@@ -393,6 +399,8 @@ def add_subprocess(request):
w.save() w.save()
new_w.widget = w new_w.widget = w
new_w.save() new_w.save()
w.defered_outputs = w.outputs.defer("value").all()
w.defered_inputs = w.inputs.defer("value").all()
return render(request, 'widgets.html', {'widgets':[w,]}) return render(request, 'widgets.html', {'widgets':[w,]})
else: else:
return HttpResponse(status=400) return HttpResponse(status=400)
...@@ -474,6 +482,10 @@ def add_for(request): ...@@ -474,6 +482,10 @@ def add_for(request):
output.save() output.save()
input.outer_output = output input.outer_output = output
input.save() input.save()
for_input.defered_outputs = for_input.outputs.defer("value").all()
for_input.defered_inputs = for_input.inputs.defer("value").all()
widget.defered_outputs = widget.outputs.defer("value").all()
widget.defered_inputs = widget.inputs.defer("value").all()
return render(request, 'widgets.html', {'widgets':[for_input,widget]}) return render(request, 'widgets.html', {'widgets':[for_input,widget]})
else: else:
return HttpResponse(status=400) return HttpResponse(status=400)
...@@ -519,6 +531,8 @@ def add_input(request): ...@@ -519,6 +531,8 @@ def add_input(request):
input.save() input.save()
output.outer_input = input output.outer_input = input
output.save() output.save()
widget.defered_outputs = widget.outputs.defer("value").all()
widget.defered_inputs = widget.inputs.defer("value").all()
return render(request, 'widgets.html', {'widgets':[widget,]}) return render(request, 'widgets.html', {'widgets':[widget,]})
else: else:
return HttpResponse(status=400) return HttpResponse(status=400)
...@@ -563,6 +577,8 @@ def add_output(request): ...@@ -563,6 +577,8 @@ def add_output(request):
output.save() output.save()
input.outer_output = output input.outer_output = output
input.save() input.save()
widget.defered_outputs = widget.outputs.defer("value").all()
widget.defered_inputs = widget.inputs.defer("value").all()
return render(request, 'widgets.html', {'widgets':[widget,]}) return render(request, 'widgets.html', {'widgets':[widget,]})
else: else:
return HttpResponse(status=400) return HttpResponse(status=400)
...@@ -603,6 +619,8 @@ def get_widget(request): ...@@ -603,6 +619,8 @@ def get_widget(request):
if request.is_ajax() or DEBUG: if request.is_ajax() or DEBUG:
w = get_object_or_404(Widget, pk=request.POST['widget_id']) w = get_object_or_404(Widget, pk=request.POST['widget_id'])
if (w.workflow.user==request.user): if (w.workflow.user==request.user):
w.defered_outputs = w.outputs.defer("value").all()
w.defered_inputs = w.inputs.defer("value").all()
return render(request, 'widgets.html', {'widgets':[w,]}) return render(request, 'widgets.html', {'widgets':[w,]})
else: else:
return HttpResponse(status=400) return HttpResponse(status=400)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment