From 32823d828845a8fe07cc34ff46f9acbb425ebc4a Mon Sep 17 00:00:00 2001 From: mdipierro Date: Wed, 5 Dec 2012 11:35:23 -0600 Subject: [PATCH] fixed issue 440, reference to primary keys --- VERSION | 2 +- gluon/dal.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index e564afa8..be1f85b0 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.3.0 (2012-12-05 11:22:29) rc1 +Version 2.3.0 (2012-12-05 11:34:39) rc1 diff --git a/gluon/dal.py b/gluon/dal.py index 5db77bfc..9dc1e720 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -8545,7 +8545,7 @@ class Field(Expression): if not isinstance(fieldname,str) or hasattr(Table,fieldname) or \ fieldname[0] == '_' or REGEX_PYTHON_KEYWORDS.match(fieldname): raise SyntaxError('Field: invalid field name: %s' % fieldname) - self.type = type if not isinstance(type, Table) else 'reference %s' % type + self.type = type if not isinstance(type, (Table,Field)) else 'reference %s' % type self.length = length if not length is None else DEFAULTLENGTH.get(self.type,512) self.default = default if default!=DEFAULT else (update or None) self.required = required # is this field required