Ticket #13640: 13640_fix_only.diff

File 13640_fix_only.diff, 981 bytes (added by b.leskes@…, 13 years ago)

Extracted the suggest fix from previous patches

  • django/db/models/sql/query.py

     
    1414from django.db import connections, DEFAULT_DB_ALIAS
    1515from django.db.models import signals
    1616from django.db.models.fields import FieldDoesNotExist
     17from django.db.models.expressions import ExpressionNode
    1718from django.db.models.query_utils import select_related_descend, InvalidQuery
    1819from django.db.models.sql import aggregates as base_aggregates_module
    1920from django.db.models.sql.constants import *
     
    10481049            value = True
    10491050        elif callable(value):
    10501051            value = value()
    1051         elif hasattr(value, 'evaluate'):
     1052        elif isinstance(value, ExpressionNode):
    10521053            # If value is a query expression, evaluate it
    10531054            value = SQLEvaluator(value, self)
    10541055            having_clause = value.contains_aggregate
Back to Top