Add correlate parameter
* Add correlate parameter to select_correlated_expression function
This commit is contained in:
		| @@ -4,6 +4,12 @@ Changelog | ||||
| Here you can see the full list of changes between each SQLAlchemy-Utils release. | ||||
|  | ||||
|  | ||||
| 0.30.17 (2015-08-16) | ||||
| ^^^^^^^^^^^^^^^^^^^^ | ||||
|  | ||||
| - Added correlate parameter to select_correlated_expression function | ||||
|  | ||||
|  | ||||
| 0.30.16 (2015-08-04) | ||||
| ^^^^^^^^^^^^^^^^^^^^ | ||||
|  | ||||
|   | ||||
| @@ -92,4 +92,4 @@ from .types import (  # noqa | ||||
|     WeekDaysType | ||||
| ) | ||||
|  | ||||
| __version__ = '0.30.16' | ||||
| __version__ = '0.30.17' | ||||
|   | ||||
| @@ -89,7 +89,8 @@ def select_correlated_expression( | ||||
|     path, | ||||
|     leaf_model, | ||||
|     from_obj=None, | ||||
|     order_by=None | ||||
|     order_by=None, | ||||
|     correlate=True | ||||
| ): | ||||
|     relationships = list(reversed(path_to_relationships(path, root_model))) | ||||
|  | ||||
| @@ -112,6 +113,8 @@ def select_correlated_expression( | ||||
|  | ||||
|     query = query.select_from(join_expr.selectable) | ||||
|  | ||||
|     return query.correlate( | ||||
|         from_obj if from_obj is not None else root_model | ||||
|     ).where(condition) | ||||
|     if correlate: | ||||
|         query = query.correlate( | ||||
|             from_obj if from_obj is not None else root_model | ||||
|         ) | ||||
|     return query.where(condition) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Konsta Vesterinen
					Konsta Vesterinen