Problem: My UpdateView looks the same as my CreateView. I would like to change the submit button from "Check" to "Update".
Here are my views in the views.py file:
class CapsUnifCreateView(CreateView):
template_name = 'capsules/uniformity_form.html'
model = models.Uniformity
fields = (
'caps_name',
'mass_1_caps_empty',
'mass_20_caps_full',
'mass_max1',
'mass_min1',
)
class CapsUnifUpdateView(UpdateView):
fields = (
'caps_name',
'mass_1_caps_empty',
'mass_20_caps_full',
'mass_max1',
'mass_min1',
)
model = models.Uniformity
Note, that I do not use a separate template for the UpdateView.
Something like
{% if CreateView %} Check {% else %} Update {% endif %}
in the html file would be nice, but I don't know how to implement it.
Thanks in advance!