Python django表单集中的异构表单

Python django表单集中的异构表单,python,django,django-forms,Python,Django,Django Forms,我对Django表单有一个特定的问题,在我看来,它应该已经有了一个解决方案 我在同一个视图中提交了两个不同的表单,类似于…(很抱歉现在只使用伪代码) 我思考这个问题的方式有问题吗?您可以向同一视图提交多个表单集,但需要避免名称冲突() 一个表单集处理表单1的实例,另一个表单集处理表单2的实例。链接更新: class Form1(): #different attributes class Form2() #different attributes <html&g

我对Django表单有一个特定的问题,在我看来,它应该已经有了一个解决方案

我在同一个视图中提交了两个不同的表单,类似于…(很抱歉现在只使用伪代码)


我思考这个问题的方式有问题吗?

您可以向同一视图提交多个表单集,但需要避免名称冲突()

一个表单集处理表单1的实例,另一个表单集处理表单2的实例。

链接更新:
class Form1():
    #different attributes

class Form2()
    #different attributes   
<html>
  <form>
    {{ 1-instance-Form1 }} 
    {{ 2-instance-Form1 }}
    {{ 1-instance-Form2 }}
    {{ 2-instance-Form2 }}
  </form>
</html>
<html>
  <form>
    {{ 1-instance-Form1 }}
    {{ 2-instance-Form1 }}
    {{ 1-instance-Form2 }}
    {{ 2-instance-Form2 }}
    {{ 3-instance-Form2 }}
  </form>
</html>
class BaseHeterogenousFormSet(StrAndUnicode):

    def append(form):
    #add one more form to the formset

    def is_valid():
    #run is_valid for each of the forms in the formset

    def clean():
        #run the clean for each of the forms ...