allow for skipping certain fields when checking for empty rows
This commit is contained in:
parent
b82bf879fd
commit
4f54192ae4
2 changed files with 7 additions and 2 deletions
|
@ -127,7 +127,11 @@ class GridFieldInstance(ListFieldInstance):
|
||||||
continue
|
continue
|
||||||
if value:
|
if value:
|
||||||
item[fi.name] = 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):
|
class RecordsFieldInstance(GridFieldInstance):
|
||||||
|
|
|
@ -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
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
@ -38,6 +38,7 @@ class Grid(schema.List):
|
||||||
instanceName='grid'))
|
instanceName='grid'))
|
||||||
|
|
||||||
column_types = []
|
column_types = []
|
||||||
|
ignoreInCheckOnEmpty = []
|
||||||
cardinality = None
|
cardinality = None
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue