[Answered ]-Django – Different forms for model

1👍

In your forms.py file, write a function that returns the correct form according to your criteria. Then import that into your view and call it there.

1👍

Write a function that returns needed form class according to the condition.

0👍

You have to use modelform fabric, it could help you to make forms for your models

FormClass = modelform_factory(ModelClass)

https://code.djangoproject.com/browser/django/trunk/django/forms/models.py#L370

Leave a comment