Decoupling of hardcoded Comment class
|Reported by:||miohtama||Owned by:||nobody|
|Severity:||Keywords:||hard-coded comment class|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
In contrib.comments we have two hardcoded comment classes. The comment engine chooses between these using this kind of expression:
manager = self.free and FreeComment.objects or Comment.objects
Instead, a free-form class name should be given in settings. This would allow the developer to supply his own Comment class with site specific relations.
comment_manager_factory_function = settings.COMMENT_MANAGER_ manager = comment_manager_factory_function(content_type, other_context_parameters)
I am willing to supply patch for this if you give me green light.