[gen] List and grid fields: bugfixes.
This commit is contained in:
parent
3e6027c499
commit
e5356e749d
|
@ -74,6 +74,13 @@ class Dict(List):
|
||||||
# while encoding/viewing this entry.
|
# while encoding/viewing this entry.
|
||||||
self.keys = keys
|
self.keys = keys
|
||||||
|
|
||||||
|
def computeWidths(self, widths):
|
||||||
|
'''Set given p_widths or compute default ones if not given.'''
|
||||||
|
if not widths:
|
||||||
|
self.widths = [''] * (len(self.fields) + 1)
|
||||||
|
else:
|
||||||
|
self.widths = widths
|
||||||
|
|
||||||
def getFormattedValue(self, obj, value, layoutType='view',
|
def getFormattedValue(self, obj, value, layoutType='view',
|
||||||
showChanges=False, language=None):
|
showChanges=False, language=None):
|
||||||
'''Formats the dict value as a list of values'''
|
'''Formats the dict value as a list of values'''
|
||||||
|
|
|
@ -99,6 +99,10 @@ class List(Field):
|
||||||
field.layouts = field.formatLayouts(subLayouts)
|
field.layouts = field.formatLayouts(subLayouts)
|
||||||
# One may specify the width of every column in the list. Indeed, using
|
# One may specify the width of every column in the list. Indeed, using
|
||||||
# widths and layouts of sub-fields may not be sufficient.
|
# widths and layouts of sub-fields may not be sufficient.
|
||||||
|
self.computeWidths(widths)
|
||||||
|
|
||||||
|
def computeWidths(self, widths):
|
||||||
|
'''Set given p_widths or compute default ones if not given.'''
|
||||||
if not widths:
|
if not widths:
|
||||||
self.widths = [''] * len(self.fields)
|
self.widths = [''] * len(self.fields)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue