use 'baseObject' for properties that are not available for adapted objects
git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@3982 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
parent
2e2f3bcf59
commit
80e834a1ac
3 changed files with 14 additions and 3 deletions
|
@ -58,7 +58,7 @@ from cybertools.relation.interfaces import IRelationRegistry
|
|||
from cybertools.stateful.interfaces import IStateful
|
||||
from cybertools.text import mimetypes
|
||||
from cybertools.typology.interfaces import IType, ITypeManager
|
||||
from loops.common import adapted
|
||||
from loops.common import adapted, baseObject
|
||||
from loops.config.base import DummyOptions
|
||||
from loops.i18n.browser import I18NView
|
||||
from loops.interfaces import IResource, IView, INode, ITypeConcept
|
||||
|
@ -283,6 +283,10 @@ class BaseView(GenericView, I18NView):
|
|||
def adapted(self):
|
||||
return adapted(self.context, self.languageInfo)
|
||||
|
||||
@Lazy
|
||||
def baseObject(self):
|
||||
return baseObject(self.context)
|
||||
|
||||
@Lazy
|
||||
def title(self):
|
||||
return self.adapted.title or getName(self.context)
|
||||
|
@ -325,7 +329,7 @@ class BaseView(GenericView, I18NView):
|
|||
|
||||
@Lazy
|
||||
def type(self):
|
||||
return IType(self.context)
|
||||
return IType(self.baseObject)
|
||||
|
||||
@Lazy
|
||||
def typeProvider(self):
|
||||
|
|
|
@ -49,6 +49,7 @@ class Basic3Columns(ConceptView):
|
|||
for idx, c in enumerate(self.context.getChildren([self.defaultPredicate])):
|
||||
text = c.title
|
||||
url = self.nodeView.getUrlForTarget(c)
|
||||
# TODO: use layout settings of c for display
|
||||
cssClass = 'span-2'
|
||||
if idx % 3 == 2:
|
||||
cssClass += ' last'
|
||||
|
|
|
@ -30,6 +30,8 @@ from zope.traversing.api import getName
|
|||
from cybertools.stateful.definition import StatesDefinition
|
||||
from cybertools.stateful.definition import State, Transition
|
||||
from cybertools.stateful.interfaces import IStatesDefinition, IStateful
|
||||
from loops.common import adapted
|
||||
from loops.integrator.interfaces import IExternalCollection
|
||||
from loops.interfaces import IAssignmentEvent, IDeassignmentEvent
|
||||
from loops.interfaces import ILoopsObject, IResource
|
||||
from loops.organize.stateful.base import StatefulLoopsObject
|
||||
|
@ -82,7 +84,8 @@ class ClassificationQualityCheckable(StatefulLoopsObject):
|
|||
versionable = IVersionable(self.context, None)
|
||||
if self.state in ('new', 'classified', 'verified'):
|
||||
parents = [r for r in self.context.getParentRelations()
|
||||
if r.predicate != self.typePredicate]
|
||||
if self.isRelevant(r)]
|
||||
#if r.predicate != self.typePredicate]
|
||||
if len(parents) > 0:
|
||||
self.doTransitionWithVersions('change_classification', versionable)
|
||||
else:
|
||||
|
@ -105,6 +108,9 @@ class ClassificationQualityCheckable(StatefulLoopsObject):
|
|||
""" Return True if the relation given is relevant for changing
|
||||
the quality state.
|
||||
"""
|
||||
#adParent = adapted(relation.first)
|
||||
#if IExternalCollection.providedBy(adParent):
|
||||
# return False
|
||||
return (IResource.providedBy(self.context) and
|
||||
getName(relation.predicate) != 'hasType')
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue