swe574-spring23 / SWE574

BOUN Spring 574 Project
MIT License
0 stars 0 forks source link

REFACTOR - Change forms to be dynamic #67

Closed ceydaduzgec closed 11 months ago

ceydaduzgec commented 1 year ago

Related comment

More can be found in documentation: https://docs.djangoproject.com/en/4.1/topics/forms/#reusable-form-templates

ceydaduzgec commented 1 year ago

You can take this code snippet that Sehmuz wrotes as an example.

<form method="POST" enctype="multipart/form-data">
    {% csrf_token %}
    {#{{ user_form.as_p }}#}
    {% for field in user_form %}
    <div class="mb-3">
        <label class="form-label">{{field.label}}</label>
        <input class="form-control" type="text" value="{{ field.value }}" >
    </div>
    {% endfor %}
    <div class="mb-3">
        <button type="submit" class="btn btn-primary"> Save changes</button>
    </div>

</form>
sehmuzc commented 11 months ago

Newer code blocks have been implemented with this proposed architecture.