Split Query add_filter and setup_joins into smaller methods for easier subclassing
|Reported by:||Fabio Corneti||Owned by:||nobody|
|Component:||Database layer (models, ORM)||Version:||master|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Projects such as Django Multilingual use an highly customized django.db.models.sql.Query subclass to support advanced custom filters; in order to do so we need to copy the entire setup_joins and add_filter methods and apply our custom code inside them.
The proposed patch splits add_filter and setup_joins in slightly smaller methods, allowing subclasses to inject custom code into filtering procedures in an easier and more maintainable way.
Tested with Django trunk using the standard test suite.