From 9cd0c333d6c0d9fd70dfb36c240749189bc19acd Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Sat, 12 Aug 2006 05:15:25 +0000 Subject: [PATCH] Fixed #2514 -- Improved psycopg2 backend to save/load Unicode strings correctly. Thanks, crankycoder@gmail.com git-svn-id: http://code.djangoproject.com/svn/django/trunk@3565 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- AUTHORS | 1 + django/db/backends/postgresql_psycopg2/base.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/AUTHORS b/AUTHORS index 2067a5984d..fb00ca43fe 100644 --- a/AUTHORS +++ b/AUTHORS @@ -60,6 +60,7 @@ answer newbie questions, and generally made Django that much better: Amit Chakradeo ChaosKCW Ian Clelland + crankycoder@gmail.com Matt Croydon Jonathan Daugherty (cygnus) Jason Davies (Esaj) diff --git a/django/db/backends/postgresql_psycopg2/base.py b/django/db/backends/postgresql_psycopg2/base.py index 55cba81b70..9623e68354 100644 --- a/django/db/backends/postgresql_psycopg2/base.py +++ b/django/db/backends/postgresql_psycopg2/base.py @@ -11,6 +11,10 @@ except ImportError, e: from django.core.exceptions import ImproperlyConfigured raise ImproperlyConfigured, "Error loading psycopg2 module: %s" % e +# Register Unicode conversions +import psycopg2.extensions +psycopg2.extensions.register_type(psycopg2.extensions.UNICODE) + DatabaseError = Database.DatabaseError try: