Add support for customized WhereNode's and QUERY_TERMS.
|Reported by:||jbronn||Owned by:||mtredinnick|
|Component:||Database layer (models, ORM)||Version:||queryset-refactor|
|Severity:||Keywords:||qs-rf where wherenode query terms gis|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
In order to get GeoDjango working with the queryset-refactor branch, a few modifications were needed to the Query class. Specifically, the GeoQuery subclass of Query needs to the GeoWhereNode instead of the regular WhereNode for the construction of spatial SQL. Moreover, QUERY_TERMS are still hard-coded in the Query class, which also needs to be extended so that geographic lookup types (e.g., within, intersects) are recognized.
This patch adds the where keyword (which sets a where_class attribute of the Query class) to Query.__init__ as well as a get_terms function, both of which may be used and/or overloaded by subclasses. I'm open to suggestions for improvement.
Change History (4)
Changed 9 years ago by jbronn
comment:1 Changed 9 years ago by mtredinnick
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Triage Stage changed from Unreviewed to Accepted
comment:2 Changed 9 years ago by mtredinnick
- Summary changed from queryset-refactor: Add support for customized WhereNode's and QUERY_TERMS. to Add support for customized WhereNode's and QUERY_TERMS.
- Version changed from other branch to queryset-refactor