M
M
maniacus262018-09-13 17:53:57
Django
maniacus26, 2018-09-13 17:53:57

How to correctly display the elements of an existing form using bootstrap 3?

There is a generic.UpdateView
with two model
fields fields = ['data', 'numvh']
There is also html that handles this case
Block fragment

{% block content %}

<form action="" method="post">
    {% csrf_token %}

<div class="form-group">
  <label>Дата:</label>
    <input type="text" class="form-control" {{ form.data }}
</div>
<div class="form-group">
  <label>Номер входящего:</label>
  <input type="text" class="form-control" {{ form.numvh }}
</div>

input type="submit" class="btn btn-default" value="Внести сведения" />
</form>

{% endblock %}

For half a day of tinkering with the Internet, only the above code allowed us to display the form in the required form
5b9a77f1a3aef072441261.png
. At the same time, as you can see, the inputs in which the form value is inserted are not closed '>' , and are displayed correctly in chrome. I understand that this is the wrong approach.
Tell me how to correctly display the existing (filled) elements when editing the form (generic.UpdateView)?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question