From 059828b319996226fb5d9136824bbf709d2def3f Mon Sep 17 00:00:00 2001 From: Gaetan Delannay Date: Thu, 6 Mar 2014 23:08:14 +0100 Subject: [PATCH] [gen] Bugfix while displaying possible values for a Ref field in edit mode. --- fields/ref.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/fields/ref.py b/fields/ref.py index 03d35d6..6e2e4e1 100644 --- a/fields/ref.py +++ b/fields/ref.py @@ -289,10 +289,12 @@ class Ref(Field): onchange=":field.getOnChange(zobj, layoutType)" multiple=":isMultiple"> - + (uid in uids)" value=":uid" + title=":title">:ztool.truncateValue(title, field.swidth) ''') pxSearch = Px(''' @@ -798,14 +800,12 @@ class Ref(Field): value = self.xhtmlToText.sub(' ', value) elif type(value) in sutils.sequenceTypes: value = ', '.join(value) - prefix = '' - if res: - prefix = ' | ' + prefix = res and ' | ' or '' res += prefix + value if unlimited: return res maxWidth = self.width or 30 if len(res) > maxWidth: - res = res[:maxWidth-2] + '...' + res = refObject.tool.o.truncateValue(res, maxWidth) return res def getIndexOf(self, obj, refObj):