Removed unnecessary casting when using builtin lookups on PostgreSQL.

This commit is contained in:
Simon Charette 2016-09-21 21:53:48 -04:00
parent 7a2c27112d
commit 658f1e81a7
1 changed files with 2 additions and 0 deletions

View File

@ -83,6 +83,8 @@ class DatabaseOperations(BaseDatabaseOperations):
'istartswith', 'endswith', 'iendswith', 'regex', 'iregex'):
if internal_type in ('IPAddressField', 'GenericIPAddressField'):
lookup = "HOST(%s)"
elif internal_type in ('CharField', 'TextField'):
lookup = '%s'
else:
lookup = "%s::text"