allow specification of columns for data table in type object
This commit is contained in:
parent
e5a2cfafa7
commit
7e9a68bde1
2 changed files with 5 additions and 1 deletions
|
@ -438,6 +438,7 @@ class CreateConceptForm(CreateObjectForm):
|
||||||
return c
|
return c
|
||||||
ad = ti(c)
|
ad = ti(c)
|
||||||
ad.__is_dummy__ = True
|
ad.__is_dummy__ = True
|
||||||
|
ad.__type__ = adapted(self.typeConcept)
|
||||||
return ad
|
return ad
|
||||||
|
|
||||||
@Lazy
|
@Lazy
|
||||||
|
|
5
table.py
5
table.py
|
@ -73,7 +73,10 @@ class DataTable(AdapterBase):
|
||||||
_adapterAttributes = AdapterBase._adapterAttributes + ('columns', 'data')
|
_adapterAttributes = AdapterBase._adapterAttributes + ('columns', 'data')
|
||||||
|
|
||||||
def getColumns(self):
|
def getColumns(self):
|
||||||
return getattr(self.context, '_columns', ['key', 'value'])
|
cols = getattr(self.context, '_columns', None)
|
||||||
|
if not cols:
|
||||||
|
cols = getattr(baseObject(self.type), '_columns', None)
|
||||||
|
return cols or ['key', 'value']
|
||||||
def setColumns(self, value):
|
def setColumns(self, value):
|
||||||
self.context._columns = value
|
self.context._columns = value
|
||||||
columns = property(getColumns, setColumns)
|
columns = property(getColumns, setColumns)
|
||||||
|
|
Loading…
Add table
Reference in a new issue