Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Waldemar Kornewald committed Oct 27, 2011
2 parents a0cf5ac + d02d111 commit 01ec476
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions djangotoolbox/db/base.py
Expand Up @@ -91,5 +91,23 @@ def __setattr__(self, name, value):
raise NotImplementedError('Cursors not supported')

class NonrelDatabaseWrapper(BaseDatabaseWrapper):
# These fake operators are required for SQLQuery.as_sql() support.
operators = {
'exact': '= %s',
'iexact': '= UPPER(%s)',
'contains': 'LIKE %s',
'icontains': 'LIKE UPPER(%s)',
'regex': '~ %s',
'iregex': '~* %s',
'gt': '> %s',
'gte': '>= %s',
'lt': '< %s',
'lte': '<= %s',
'startswith': 'LIKE %s',
'endswith': 'LIKE %s',
'istartswith': 'LIKE UPPER(%s)',
'iendswith': 'LIKE UPPER(%s)',
}

def _cursor(self):
return FakeCursor()

0 comments on commit 01ec476

Please sign in to comment.