modern-doctor-63477
04/29/2022, 12:49 AMmysterious-toddler-20573
04/29/2022, 2:18 AMfew-vegetable-15970
04/30/2022, 2:08 AMhappy-microphone-42295
05/02/2022, 1:59 PMhundreds-camera-24900
05/02/2022, 2:14 PMwhite-motorcycle-95262
05/02/2022, 2:20 PM__init__
and filter one of my ModelChoiceFields
there. This would result in a reduced select.
Anyone know the "Django way" of just getting one fields HTML in a view? Based on being able to do {{ form.field_name }}
in the template, I found I can do the following in a view:
def my_htmx_endpoint(request)
form = MyForm()
html = str(form['field_name'])
response = HttpResponse(html)
return response
But is there something "better" I should be doing, perhaps with the render
shortcut?hundreds-camera-24900
05/02/2022, 2:36 PMhundreds-camera-24900
05/02/2022, 2:36 PMhundreds-camera-24900
05/02/2022, 2:36 PMhundreds-camera-24900
05/02/2022, 2:36 PMhundreds-camera-24900
05/02/2022, 2:37 PMhundreds-camera-24900
05/02/2022, 2:37 PMhundreds-camera-24900
05/02/2022, 2:38 PMwhite-motorcycle-95262
05/02/2022, 2:38 PMhundreds-camera-24900
05/02/2022, 2:39 PMhundreds-camera-24900
05/02/2022, 2:39 PMhundreds-camera-24900
05/02/2022, 2:39 PMhundreds-camera-24900
05/02/2022, 2:40 PMwhite-motorcycle-95262
05/02/2022, 2:40 PMhundreds-camera-24900
05/02/2022, 2:40 PMwhite-motorcycle-95262
05/02/2022, 2:40 PMwhite-motorcycle-95262
05/02/2022, 2:41 PMwhite-motorcycle-95262
05/02/2022, 2:41 PMhundreds-camera-24900
05/02/2022, 2:44 PMfew-vegetable-15970
05/02/2022, 4:49 PMfew-vegetable-15970
05/02/2022, 4:51 PMinclude
accordingly.
Your opinions?hundreds-camera-24900
05/02/2022, 7:54 PMhundreds-camera-24900
05/02/2022, 7:54 PM