diff options
author | Claude Paroz <claude@2xlibre.net> | 2012-06-07 18:08:47 +0200 |
---|---|---|
committer | Claude Paroz <claude@2xlibre.net> | 2012-06-07 18:08:47 +0200 |
commit | 4a103086d5c67fa4fcc53c106c9fdf644c742dd8 (patch) | |
tree | 3df00600c27f6369f7561c3b8ddf2f97d2d341d9 /django/db/backends/postgresql_psycopg2/operations.py | |
parent | 706fd9adc0b6587c7f96a834c757708e64fcf615 (diff) | |
download | django-4a103086d5c67fa4fcc53c106c9fdf644c742dd8.tar.gz |
Fixed #18269 -- Applied unicode_literals for Python 3 compatibility.
Thanks Vinay Sajip for the support of his django3 branch and
Jannis Leidel for the review.
Diffstat (limited to 'django/db/backends/postgresql_psycopg2/operations.py')
-rw-r--r-- | django/db/backends/postgresql_psycopg2/operations.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/django/db/backends/postgresql_psycopg2/operations.py b/django/db/backends/postgresql_psycopg2/operations.py index 395cd92047..46b464b551 100644 --- a/django/db/backends/postgresql_psycopg2/operations.py +++ b/django/db/backends/postgresql_psycopg2/operations.py @@ -1,3 +1,5 @@ +from __future__ import unicode_literals + from django.db.backends import BaseDatabaseOperations @@ -21,14 +23,14 @@ class DatabaseOperations(BaseDatabaseOperations): """ modifiers = [] if timedelta.days: - modifiers.append(u'%s days' % timedelta.days) + modifiers.append('%s days' % timedelta.days) if timedelta.seconds: - modifiers.append(u'%s seconds' % timedelta.seconds) + modifiers.append('%s seconds' % timedelta.seconds) if timedelta.microseconds: - modifiers.append(u'%s microseconds' % timedelta.microseconds) - mods = u' '.join(modifiers) - conn = u' %s ' % connector - return u'(%s)' % conn.join([sql, u'interval \'%s\'' % mods]) + modifiers.append('%s microseconds' % timedelta.microseconds) + mods = ' '.join(modifiers) + conn = ' %s ' % connector + return '(%s)' % conn.join([sql, 'interval \'%s\'' % mods]) def date_trunc_sql(self, lookup_type, field_name): # http://www.postgresql.org/docs/8.0/static/functions-datetime.html#FUNCTIONS-DATETIME-TRUNC |