make sure datatable-based vocabulary is also usable in management interface
This commit is contained in:
parent
a673cbcead
commit
ff82b2bc49
1 changed files with 6 additions and 3 deletions
9
table.py
9
table.py
|
@ -1,5 +1,5 @@
|
||||||
#
|
#
|
||||||
# Copyright (c) 2011 Helmut Merz helmutm@cy55.de
|
# Copyright (c) 2012 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
|
||||||
|
@ -29,6 +29,7 @@ from zope.schema.interfaces import IContextSourceBinder, IIterableSource
|
||||||
|
|
||||||
from cybertools.composer.schema.factory import SchemaFactory
|
from cybertools.composer.schema.factory import SchemaFactory
|
||||||
from cybertools.composer.schema.grid.interfaces import KeyTable
|
from cybertools.composer.schema.grid.interfaces import KeyTable
|
||||||
|
from cybertools.composer.interfaces import IInstance
|
||||||
from loops.common import AdapterBase, adapted, baseObject
|
from loops.common import AdapterBase, adapted, baseObject
|
||||||
from loops.interfaces import IConcept, IConceptSchema, ILoopsAdapter
|
from loops.interfaces import IConcept, IConceptSchema, ILoopsAdapter
|
||||||
from loops.type import TypeInterfaceSourceList
|
from loops.type import TypeInterfaceSourceList
|
||||||
|
@ -111,8 +112,10 @@ class DataTableSourceBinder(object):
|
||||||
self.tableName = tableName
|
self.tableName = tableName
|
||||||
|
|
||||||
def __call__(self, instance):
|
def __call__(self, instance):
|
||||||
#context = baseObject(instance.context)
|
if IInstance.providedBy(instance):
|
||||||
context = instance.view.nodeView.context
|
context = instance.view.nodeView.context
|
||||||
|
else:
|
||||||
|
context = baseObject(instance.context)
|
||||||
dt = context.getLoopsRoot().getConceptManager()[self.tableName]
|
dt = context.getLoopsRoot().getConceptManager()[self.tableName]
|
||||||
return DataTableSourceList(adapted(dt))
|
return DataTableSourceList(adapted(dt))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue