How to extend the comments framework (django) by removing unnecessary fields?

前端 未结 3 1044
忘掉有多难
忘掉有多难 2020-12-24 15:15

I\'ve been reading on the django docs about the comments framework and how to customize it (http://docs.djangoproject.com/en/1.1/ref/contrib/comments/custom/) In that page,

3条回答
  •  [愿得一人]
    2020-12-24 15:42

    A tidy summary of how to do this elegantly, through the actual comments framework subclassing approach, rather than hiding elements in a form/other untidy hacks, can be found Django Comments: Want to remove user URL, not expand the model. How to?

    Essentially, you subclass the CommentForm, and change its get_comment_create_data(self) method, and then pop out the attributes you don't want (e.g. email, url, etc.)

    J

提交回复
热议问题