Hi all,
I Have a list of patients and I would like introduce an instant source bar to filter patient if user input chars in the source bar: for example if user input letter “a” all patient who start with letter “a” are shown and the same if user insert other letters “an” “ant” and so on.
the view.py file contain:
def admin_view_patient_view(request):
patients=models.Patient.objects.all().filter(status=True)
return render(request,'hospital/admin_view_patient.html',{'patients':patients})
while html page contain:
<div class="container">
<div class="panel panel-primary">
<div class="panel-heading">
<h6 class="panel-title">Patient</h6>
</div>
<div id="table-scroll">
<table class="table table-hover" id="dev-table">
<thead>
<tr>
<th>Name</th>
</tr>
</thead>
{% for p in patients %}
<tr>
<td> {{p.get_name}}</td>
</tr>
{% endfor %}
</table>
</div>
</div>
</div>
it is possible? the same I would like for
MoldeChoiseField to help user find quickly what he desire
for example I have in form.py
class PatientForm(forms.ModelForm):
assignedDoctorId=forms.ModelChoiceField(queryset=models.Doctor.objects.all().filter(status=True),empty_label="Name and Department")
while in html the line
<div class="form-group">
{% render_field patientForm.assignedDoctorId class="form-control" placeholder="Doctor" %}
</div>
it is possible?
many thanks in advance
best regards