summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2005-12-09 02:32:59 +0000
committerAdrian Holovaty <adrian@holovaty.com>2005-12-09 02:32:59 +0000
commit99f0f414d5ff74aa24355ad4d4cff5a4110e51df (patch)
tree5c0091f68862b5a6ce4f77f64c7c43208394dc68 /django
parent661613e52969c63a5c2fcca79e30d5b23bc9e100 (diff)
Fixed #1006 -- Fixed error when using ChangeManipulator in a model with raw_id_admin on ForeignKey. Thanks, Gustavo Picon
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1577 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
-rw-r--r--django/core/formfields.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/django/core/formfields.py b/django/core/formfields.py
index 1ae4873fa2..c1084fad95 100644
--- a/django/core/formfields.py
+++ b/django/core/formfields.py
@@ -325,11 +325,13 @@ class FormField:
class TextField(FormField):
input_type = "text"
- def __init__(self, field_name, length=30, maxlength=None, is_required=False, validator_list=[]):
+ def __init__(self, field_name, length=30, maxlength=None, is_required=False, validator_list=[], member_name=None):
self.field_name = field_name
self.length, self.maxlength = length, maxlength
self.is_required = is_required
self.validator_list = [self.isValidLength, self.hasNoNewlines] + validator_list
+ if member_name != None:
+ self.member_name = member_name
def isValidLength(self, data, form):
if data and self.maxlength and len(data.decode(DEFAULT_CHARSET)) > self.maxlength: