Задать вопрос

Тел: +7 965 3737 888

527

Просмотров

1

Ответов

Multiple Model Forms feeding a single Form to use with a single FormView

This is a simple example of feeding multiple Forms into a single Form via its constructor method, to work with a single FormView and reap the benefits of Django's awesome Form validation system. It's a Form class that defines (or takes via an argument to its constructor) parent Forms (that can, for instance, be ModelForms, to take advantage of the automatic Field generation) and takes its fields from there.

An advanced user won't be impressed by this, so excuse if this snippet is out of place, but a rather inexperienced user such as myself might find it interesting and make him willing to explore Django's internals a bit more.

Вопрос полезен? Да0/Нет0
file_3969.py(1.6Кб)
None

Ответы (1):

Ответagustinlado:02.10.2014
Ответ полезен? Да0/Нет0

I got confused by an Internal Server Error after posting the snippet and tried again, failing to notice it had already been created. I'm sorry! Delete this duplicate, please.