def last_executed_query(self, cursor, sql, params):
    '\n        Returns a string of the query last executed by the given cursor, with\n        placeholders replaced with actual values.\n\n        `sql` is the raw query containing placeholders, and `params` is the\n        sequence of parameters. These are used by default, but this method\n        exists for database backends to provide a better implementation\n        according to their own quoting schemes.\n        '
    from django.utils.encoding import smart_unicode, force_unicode
    to_unicode = (lambda s: force_unicode(s, strings_only=True, errors='replace'))
    if isinstance(params, (list, tuple)):
        u_params = tuple([to_unicode(val) for val in params])
    else:
        u_params = dict([(to_unicode(k), to_unicode(v)) for (k, v) in params.items()])
    return (smart_unicode(sql) % u_params)
Returns a string of the query last executed by the given cursor, with
placeholders replaced with actual values.

`sql` is the raw query containing placeholders, and `params` is the
sequence of parameters. These are used by default, but this method
exists for database backends to provide a better implementation
according to their own quoting schemes.
def last_executed_query(self, cursor, sql, params):
    '\n        Returns a string of the query last executed by the given cursor, with\n        placeholders replaced with actual values.\n\n        `sql` is the raw query containing placeholders, and `params` is the\n        sequence of parameters. These are used by default, but this method\n        exists for database backends to provide a better implementation\n        according to their own quoting schemes.\n        '
    from django.utils.encoding import smart_unicode, force_unicode
    to_unicode = (lambda s: force_unicode(s, strings_only=True, errors='replace'))
    if isinstance(params, (list, tuple)):
        u_params = tuple([to_unicode(val) for val in params])
    else:
        u_params = dict([(to_unicode(k), to_unicode(v)) for (k, v) in params.items()])
    return (smart_unicode(sql) % u_params)