diff options
| author | Jacob Kaplan-Moss <jacob@jacobian.org> | 2007-09-14 18:36:04 +0000 |
|---|---|---|
| committer | Jacob Kaplan-Moss <jacob@jacobian.org> | 2007-09-14 18:36:04 +0000 |
| commit | eea935a7f410b6ebda562d3d24d72f2b3fdda4b9 (patch) | |
| tree | 16c978b63db8d70af241e38f96f3b9788a6ef268 /django | |
| parent | c998feb3bb97cfd8f7ca00aeb6a0fa61f4815f07 (diff) | |
Fixed #5448: you can now use unicode characters in primary keys. Thanks, pigletto.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6200 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
| -rw-r--r-- | django/db/models/base.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/django/db/models/base.py b/django/db/models/base.py index b7d6e93def..f7b9069cce 100644 --- a/django/db/models/base.py +++ b/django/db/models/base.py @@ -12,7 +12,7 @@ from django.db.models.loading import register_models, get_model from django.dispatch import dispatcher from django.utils.datastructures import SortedDict from django.utils.functional import curry -from django.utils.encoding import smart_str, force_unicode +from django.utils.encoding import smart_str, force_unicode, smart_unicode from django.conf import settings from itertools import izip import types @@ -213,7 +213,7 @@ class Model(object): pk_val = self._get_pk_val() # Note: the comparison with '' is required for compatibility with # oldforms-style model creation. - pk_set = pk_val is not None and pk_val != u'' + pk_set = pk_val is not None and smart_unicode(pk_val) != u'' record_exists = True if pk_set: # Determine whether a record with the primary key already exists. |
