Split contrib.comments CommentForm class to allow easier customization
|Reported by:||arne||Owned by:||nobody|
|Cc:||carljm||Triage Stage:||Design decision needed|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
The CommentForm class in contrib/comments/forms.py is very monolithic and contains all spam-checking code and the application-specific code.
Splitting the Form into a BaseCommentForm class which contains only the spam-checking code and a CommentForm class which only contains the application-specific code would allow much easier customization of the comments-app.
Using the hooks from #8630 and defining your own model and form (which for example don't include fields for email and url) would either need a copy of the whole form-class code including the modification (about 100 lines of code) or one must subclass the current CommentForm class and manually delete the fields (email and url in this example) before using the form.
The appended patch splits the current CommentForm class into two classes which would allow easier customization of the comments-app. When reviewing this ticket please also see #8630 for more details.
Change History (13)
Changed 5 years ago by arne
comment:1 Changed 5 years ago by carljm
- Cc carljm added
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
comment:2 Changed 5 years ago by thejaswi_puthraya
- Triage Stage changed from Unreviewed to Design decision needed