Как назначить собственное имя для формы модели в django например ..
<input name="product_stock" class="form-control" type="text" id="productStock" placeholder="">
вместо name='product_stock'
тег доступа с ProductStock
в форме модели и как назначить в view.py
forms.py
class ProductForm(forms.ModelForm):
class Meta:
model = Products
fields = [
'product_name', 'product_image', 'product_stock', 'product_status',
'product_added_use', 'product_deleted_user'
]
стр. html
<form class="pl-3 pr-3" method="POST">
{% csrf_token %}
<div class="form-group">
<label for="productName">Product Name</label>
<input name='product_name' class="form-control" type="text" id="productName" required="" placeholder="Michael Zenaty">
</div>
<div class="form-group">
<label for="productimage">Product Image</label>
<input name="product_image" class="form-control" type="file" id="productimage" placeholder="">
</div>
<div class="form-group">
<label for="productStock">Product Stock</label>
<input name="product_stock" class="form-control" type="text" id="productStock" placeholder="">
</div>
</div>