From 57bab294477134dd7c52b3e1a218fa6a566b6f6d Mon Sep 17 00:00:00 2001 From: Gaetan Delannay Date: Sat, 17 May 2014 16:44:56 +0200 Subject: [PATCH] [gen] Bugfixes. --- fields/boolean.py | 3 ++- fields/computed.py | 5 +++-- gen/layout.py | 2 +- gen/mixins/ToolMixin.py | 2 +- gen/wrappers/ToolWrapper.py | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/fields/boolean.py b/fields/boolean.py index dc51a46..191f62d 100644 --- a/fields/boolean.py +++ b/fields/boolean.py @@ -75,7 +75,8 @@ class Boolean(Field): cLayouts = {'view': 'lf|', 'edit': 'flrv|'} def getDefaultLayouts(self): - return {'view': 'lf', 'edit': Table('f;lrv;=', width=None)} + return {'view': 'lf', 'edit': Table('f;lrv;=', width=None), + 'search': 'l-f'} def getValue(self, obj): '''Never returns "None". Returns always "True" or "False", even if diff --git a/fields/computed.py b/fields/computed.py index 1065a7c..fc16535 100644 --- a/fields/computed.py +++ b/fields/computed.py @@ -26,8 +26,9 @@ class Computed(Field): ::value''') pxSearch = Px(''' - ''') + ''') def __init__(self, validator=None, multiplicity=(0,1), default=None, show=('view', 'result'), page='main', group=None, diff --git a/gen/layout.py b/gen/layout.py index b3d3874..b0809fe 100644 --- a/gen/layout.py +++ b/gen/layout.py @@ -222,7 +222,7 @@ centeredPageLayouts = { # The default layout for fields. Alternative layouts may exist and are declared # as static attributes of the concerned Type subclass. -defaultFieldLayouts = {'edit': 'lrv-f'} +defaultFieldLayouts = {'edit': 'lrv-f', 'search': 'l-f'} # ------------------------------------------------------------------------------ class ColumnLayout: diff --git a/gen/mixins/ToolMixin.py b/gen/mixins/ToolMixin.py index 380adc2..b1ecf1d 100644 --- a/gen/mixins/ToolMixin.py +++ b/gen/mixins/ToolMixin.py @@ -585,7 +585,7 @@ class ToolMixin(BaseMixin): hasStar = name.find('*') != -1 fieldName = not hasStar and name[2:] or name[2:name.find('*')] field = self.getAppyType(fieldName, rq.form['className']) - if field and not field.persist: continue + if field and not field.persist and not field.indexed: continue # We have a(n interval of) value(s) that is not empty for a # given field or index. value = rq.form[name] diff --git a/gen/wrappers/ToolWrapper.py b/gen/wrappers/ToolWrapper.py index cedd7fe..a47ba1d 100644 --- a/gen/wrappers/ToolWrapper.py +++ b/gen/wrappers/ToolWrapper.py @@ -366,7 +366,7 @@ class ToolWrapper(AbstractWrapper):