From 8420020c215d79f7855d8f92c97dbb0ad27bd977 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Mon, 20 Jul 2015 02:07:47 -0500 Subject: [PATCH] caching only refault represent for references --- gluon/sqlhtml.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gluon/sqlhtml.py b/gluon/sqlhtml.py index 20d62f09..ff2df550 100644 --- a/gluon/sqlhtml.py +++ b/gluon/sqlhtml.py @@ -29,7 +29,7 @@ from gluon.html import URL, FIELDSET, P, DEFAULT_PASSWORD_DISPLAY from pydal.base import DEFAULT from pydal.objects import Table, Row, Expression, Field from pydal.adapters.base import CALLABLETYPES -from pydal.helpers.methods import smart_query, bar_encode +from pydal.helpers.methods import smart_query, bar_encode, _repr_ref from pydal.helpers.classes import Reference, SQLCustomType from gluon.storage import Storage from gluon.utils import md5_hash @@ -2701,7 +2701,8 @@ class SQLFORM(FORM): value, row[field.tablename]) except KeyError: nvalue = None - repr_cache[field][value] = nvalue + if isinstance(field, _repr_ref): + repr_cache[field][value] = nvalue else: try: nvalue = field.represent(value, row)