@@ -64,40 +64,4 def jars_conf_edit(request, id_conf): | |||
|
64 | 64 | kwargs['suptitle'] = 'Edit' |
|
65 | 65 | kwargs['button'] = 'Save' |
|
66 | 66 | |
|
67 |
return render(request, 'jars_conf_edit.html', kwargs) |
|
|
68 | ||
|
69 | def jars_conf_edit_prueba(request, id_conf, type): | |
|
70 | ||
|
71 | conf = get_object_or_404(JARSConfiguration, pk=id_conf) | |
|
72 | ||
|
73 | if request.method=='GET': | |
|
74 | if type == 'PDATA': | |
|
75 | form = JARSConfigurationForm_Pro(instance=conf) | |
|
76 | html = 'jars_conf_edit_pro.html' | |
|
77 | else: | |
|
78 | form = JarsConfigurationForm_Raw(instance=conf) | |
|
79 | html = 'jars_conf_edit_raw.html' | |
|
80 | ||
|
81 | if request.method=='POST': | |
|
82 | if type == 'PDATA': | |
|
83 | form = JARSConfigurationForm_Pro(instance=conf) | |
|
84 | html = 'jars_conf_edit_pro.html' | |
|
85 | else: | |
|
86 | form = JarsConfigurationForm_Raw(instance=conf) | |
|
87 | html = 'jars_conf_edit_raw.html' | |
|
88 | ||
|
89 | if form.is_valid(): | |
|
90 | conf = form.save(commit=False) | |
|
91 | conf.save() | |
|
92 | return redirect('url_jars_conf', id_conf=conf.id) | |
|
93 | ||
|
94 | ##ERRORS | |
|
95 | ||
|
96 | kwargs = {} | |
|
97 | kwargs['id_dev'] = conf.id | |
|
98 | kwargs['form'] = form | |
|
99 | kwargs['title'] = 'Device Configuration' | |
|
100 | kwargs['suptitle'] = 'Edit' | |
|
101 | kwargs['button'] = 'Save' | |
|
102 | ||
|
103 | return render(request, html, kwargs) No newline at end of file | |
|
67 | return render(request, 'jars_conf_edit.html', kwargs) No newline at end of file |
General Comments 0
You need to be logged in to leave comments.
Login now