oTree Forum >

Loop over choices but specifying choices

#1 by ksrini


I have a number of boolean fields. I use get_form_fields to get one of them on my page
p500 = models.BooleanField()
p250 = models.BooleanField()

On my page, I want the radio buttons to be in different columns 

{{ for choice in form }}
    <td> some text 1 {{ choice.1 }} </td>
    <td> some text 2 {{ choice.0 }} </td>
{{ endfor }}

Is there a way to extract the choices from the formfield without using raw HTML input? 

I use otree 5.4.0


Write a reply

Set forum username