
I do a survey and want to create a fill-in-the-blank text. (How it looks right now).
I use Django and CSS and can display it vertically, but how can I display my text and my IntegerFields horizontally within the same sentence? Since I use CSS I would like to code it within my forms.py file and not the template file.
Anybody has an idea on how to do it?
Thanks!
forms.py
class SurveyPolicy(forms.Form):
policy6b = forms.IntegerField(
# required=False,
label='',
widget=forms.NumberInput()
)
def __init__(self, *args, **kwargs):
super(SurveyPolicy, self).__init__(*args, **kwargs)
self.helper = FormHelper()
self.helper.form_id = 'survey-form'
self.helper.label_class = 'col-lg-12'
self.helper.field_class = 'col-lg-12'
self.desc = "example"
self.helper.layout = Layout(
Fieldset(
"<hr><h6 style='color: #2D2D2D; font-family: Arial;'>Die Maßnahmen sollten zu</h5>",
Div('policy6b', css_class='form-group row-ml-0 mb-0'),
),
Fieldset(
"<h6 style='color: #2D2D2D; font-family: Arial;'>% durch eine Abgabe auf konventionelle Energieträger wie z.B. Erdgas finanziert werden - schließlich sollten Leute, die mehr CO2-Ausstoß verursachen auch mehr bezahlen.</h5>",
),
[...]