Skip to content Skip to sidebar Skip to footer

I Want To Edit Sizeproductmapping Model Using Django Forms But The Form Is Not Rendering - Django

I am trying to create a edit form to update the database using Django model Forms but the problem is that edit form part of the sizeProductMap.html page is not rendering when edit

Solution 1:

I've found out the answer. There was a really a silly mistake by me.

In the sizeProductMap.html there is a mistake let me point out that:

sizeProductMap.html

 {% if sizeProductMap_edit %}
            <formaction="{% url 'admin-size-product-map-edit' x.size_p_map_id %}"method="POST">
                {% csrf_token %}
                {{form.size_id}}
                {{form.prod_id}}
            </form>
            {% endif %}

Here I am checking for instance {% if sizeProductMap_edit %} this is the wrong thing. I have to check {% if instance %} according to my views.py.

Post a Comment for "I Want To Edit Sizeproductmapping Model Using Django Forms But The Form Is Not Rendering - Django"