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.
- [Answered ]-Login to remote website
- [Answered ]-Not able to add html tags through jQuery in django
- [Answered ]-Good way to convert Python (django) entity classes to Java
- [Answered ]-Understanding VIew evaluation in Django
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
Source:stackexchange.com