I'm a beginner and I was trying to create a registered data form in the database, all the fields are registered well instead of the multiple select fields.
from.py
class SavePost(forms.ModelForm):
user = forms.IntegerField(help_text = "User Field is required.")
title = forms.CharField(max_length=250,help_text = "Title Field is required.")
description = forms.Textarea()
dep = forms.Textarea()
class Meta:
model= Post
fields = ('user','title','description','file_path', 'file_path2', 'dep')
HTML
<div class="form-group mb-3 ">
<label for="exampleFormControlSelect2"> multiple select</label>
<select multiple class="form-control" id="dep" value={{ post.title }}>
<option>Process</option>
<option>Product</option>
<option>Equipment</option>
</select>
</div>
<div class="form-group mb-3 ">
<label for="title" class="control-label">Title</label>
<input type="text" class="form-control rounded-0" id="title" name="title" value="{{ post.title }}" required>
</div>
<div class="form-group mb-3">
<label for="description" class="control-label">Description</label>
<textarea class="form-control rounded-0" name="description" id="description" rows="5" required>{{ post.description }}</textarea>
thank you in advanced