Making Django Form dynamically

23 views
Skip to first unread message

Jordan Micle

unread,
Nov 5, 2019, 10:09:36 PM11/5/19
to Django users
in general when we define django form we set the model of django in class Meta, like below

class Form(forms.ModelForm):

    class Meta:
        model = ModelName
        fields = '__all__'
        


But I am going to set this ModelName dynamically
like this.
class Form(forms.ModelForm, modelparameter Model):

    class Meta:
        model = Model
        fields = '__all__'

Is that possible?

Budi Hermansyah

unread,
Nov 5, 2019, 10:36:01 PM11/5/19
to django...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/7c466d3c-d9da-4f42-8c7b-e2a6428aa235%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages