Ticket #14110: where.cast.diff

File where.cast.diff, 948 bytes (added by Suor, 5 years ago)
  • django/db/models/sql/where.py

     
     1# -*- coding: utf-8 -*-
    12"""
    23Code to manage the creation and SQL rendering of 'where' constraints.
    34"""
     
    168169            value_annot = True
    169170
    170171        if lookup_type in connection.operators:
    171             format = "%s %%s %%s" % (connection.ops.lookup_cast(lookup_type),)
     172            format = "%s %%s" % (connection.ops.lookup_cast(lookup_type),)
    172173            return (format % (field_sql,
    173                               connection.operators[lookup_type] % cast_sql,
    174                               extra), params)
     174                              connection.operators[lookup_type] % (cast_sql or extra)),
     175                              params)
    175176
    176177        if lookup_type == 'in':
    177178            if not value_annot:
Back to Top