Split Query add_filter and setup_joins into smaller methods for easier subclassing
|Reported by:||fabiocorneti||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.
Change History (5)
Changed 8 years ago by fabiocorneti
comment:1 follow-up: ↓ 2 Changed 8 years ago by Alex
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset