I have to create an Invoice Form (that inherits IndicoForm, perhaps?) which contains an arbitrary long list of Invoice Items (a description + quantity + price of the item on the invoice).
Here’s what I have so far in my forms.py code (just a “skeleton”, so far, hence the min_entries=2, etc.):
class InvoiceItemForm(IndicoForm): description = StringField(_('Description'), [DataRequired()]) number_of_units = IntegerField(_('Number of Units'), [DataRequired()]) unit_price = FloatField(_('Unit price'), [DataRequired()]) class InvoiceForm(IndicoForm): sequential_number = StringField(_('Invoice #'), [DataRequired()]) items = FieldList(FormField(InvoiceItemForm), min_entries=2)
, but it renders like this:
Quite an ugly rendering!
Any way I can tell WTForms (or some other way) to render the individual fields of the 2 items horizontally, instead of vertically as shown above?
Anyway I can “remove” the Items-0 and Items-1 bullet points in the rendering?