2
这是django.contrib.comments.forms形式文件:如何使用django.contrib.comments.forms创建表单?
https://github.com/django/django/blob/master/django/contrib/comments/forms.py
我需要创建一个表单的对象,并在模板中使用它。我不想在模板中手动创建html表单对象,我想重新使用contrib.comments.forms。
我该怎么办?
什么是MyModel这里? – shibly 2012-02-02 12:18:19
CommentForm需要'__init__'中的对象。 MyObject是任何你的模型,评论将被分配给哪个模型。 – demalexx 2012-02-02 13:58:18
但是,如果你看到这个代码,https://github.com/django/django/blob/master/django/contrib/comments/forms.py#L182,该参数不是一个模型,而是'CommentDetailsForm'类 – shibly 2012-02-02 18:06:44