How to create dynamic inputs with Django?

1

I am making a form to add many products to the same collection and I want the collection form to create the collection with an unlimited list of products.

My form is this:

class TendenciaForm(forms.ModelForm):
    class Meta:
        model = Tendencia
        fields = ['nombre']

    producto = forms.ModelChoiceField(
        queryset=Marca.objects.all(),
        widget=autocomplete.ModelSelect2(url='producto-autocomplete')
    )

I know that there are formset but they are limited to an amount and I want all the products they need to be sent at the same time.

    
asked by F Delgado 16.04.2018 в 13:31
source

1 answer

1

You can find lots of information in an article by Jacob Kaplan-Moss you will find step by step and a clear example: dinamic forms

    
answered by 17.04.2018 / 23:31
source