diff --git a/composer/schema/grid/field.py b/composer/schema/grid/field.py index 78f57a2..3630f82 100644 --- a/composer/schema/grid/field.py +++ b/composer/schema/grid/field.py @@ -127,7 +127,11 @@ class GridFieldInstance(ListFieldInstance): continue if value: item[fi.name] = value - return item + ignoreInCheckOnEmpty = getattr(self.context, 'ignoreInCheckOnEmpty', []) + for k, v in item.items(): + if k not in ignoreInCheckOnEmpty and v != '__no_change__': + return item + return {} class RecordsFieldInstance(GridFieldInstance): diff --git a/composer/schema/grid/interfaces.py b/composer/schema/grid/interfaces.py index 1979be0..bc521d9 100644 --- a/composer/schema/grid/interfaces.py +++ b/composer/schema/grid/interfaces.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2011 Helmut Merz helmutm@cy55.de +# Copyright (c) 2013 Helmut Merz helmutm@cy55.de # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -38,6 +38,7 @@ class Grid(schema.List): instanceName='grid')) column_types = [] + ignoreInCheckOnEmpty = [] cardinality = None