Changes between Initial Version and Version 1 of Ticket #11169
- Timestamp:
- May 21, 2009, 7:40:03 AM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #11169 – Description
initial v1 2 2 3 3 Viz: assume MySQL is the default database as quoted in the project's settings.py file 4 4 {{{ 5 5 >>> import MSSQL.model 6 6 >>> MSSQL.model.RandomTable.get(field__startswith='ticket') … … 24 24 return self.cursor.execute(sql, params) 25 25 ProgrammingError: ('42000', '[42000] [FreeTDS][SQL Server]Statement(s) could not be prepared. (8180) (SQLPrepare)') 26 26 }}} 27 27 28 28 Does anyone know how to find the correct connection in the "as_sql" subroutine in django.db.models.sql.where, or do we need to call django.db.models.sql.where.as_sql with the appropriate "connection" as a parameter? 29 29 30 30 Affected lines: 31 {{{ 31 32 156: cast_sql = connection.ops.datetime_cast_sql() 32 33 166: if lookup_type in connection.operators: … … 37 38 190: return connection.ops.regex_lookup(lookup_type) % (field_sql, cast_sql), params 38 39 205: return connection.ops.field_cast_sql(db_type) % lhs 39 40 }}} 40 41 41 42 Just incase it has a bearing on the matter I'm using a DB-Manager for the tables of the form: 42 43 {{{ 43 44 class ODBCManager(models.Manager): 44 45 use_for_related_fields = True … … 57 58 self.cached_connection = True 58 59 return QuerySet(self.model,self.query) 60 }}}