mirror of
				https://github.com/django/django.git
				synced 2025-10-31 01:25:32 +00:00 
			
		
		
		
	Fixed #13640: Avoid generating an exception when a model has an attribute named 'evaluate'. Thanks LukaszKorzybski and tobias.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17093 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
		| @@ -14,6 +14,7 @@ from django.utils.encoding import force_unicode | ||||
| from django.utils.tree import Node | ||||
| from django.db import connections, DEFAULT_DB_ALIAS | ||||
| from django.db.models import signals | ||||
| from django.db.models.expressions import ExpressionNode | ||||
| from django.db.models.fields import FieldDoesNotExist | ||||
| from django.db.models.query_utils import InvalidQuery | ||||
| from django.db.models.sql import aggregates as base_aggregates_module | ||||
| @@ -1064,7 +1065,7 @@ class Query(object): | ||||
|             value = True | ||||
|         elif callable(value): | ||||
|             value = value() | ||||
|         elif hasattr(value, 'evaluate'): | ||||
|         elif isinstance(value, ExpressionNode): | ||||
|             # If value is a query expression, evaluate it | ||||
|             value = SQLEvaluator(value, self) | ||||
|             having_clause = value.contains_aggregate | ||||
|   | ||||
		Reference in New Issue
	
	Block a user