allow adapterindexattributes title getter
This commit is contained in:
parent
d4edd8ee7a
commit
1cf6bd3c06
1 changed files with 8 additions and 6 deletions
14
concept.py
14
concept.py
|
@ -209,7 +209,7 @@ class Concept(Contained, Persistent):
|
||||||
IConcept.providedBy(r.second))
|
IConcept.providedBy(r.second))
|
||||||
return sorted(rels, key=sort)
|
return sorted(rels, key=sort)
|
||||||
|
|
||||||
def getChildren(self, predicates=None, sort='default',
|
def getChildren(self, predicates=None, sort='default',
|
||||||
noSecurityCheck=False, usePredicateIndex=False):
|
noSecurityCheck=False, usePredicateIndex=False):
|
||||||
return [r.second for r in self.getChildRelations(
|
return [r.second for r in self.getChildRelations(
|
||||||
predicates, sort=sort,
|
predicates, sort=sort,
|
||||||
|
@ -222,16 +222,16 @@ class Concept(Contained, Persistent):
|
||||||
relationships = [ConceptRelation(None, self, p) for p in predicates]
|
relationships = [ConceptRelation(None, self, p) for p in predicates]
|
||||||
if sort == 'default':
|
if sort == 'default':
|
||||||
sort = lambda x: (x.first.title and x.first.title.lower())
|
sort = lambda x: (x.first.title and x.first.title.lower())
|
||||||
rels = (r for r in getRelations(parent, self, relationships=relationships,
|
rels = (r for r in getRelations(parent, self, relationships=relationships,
|
||||||
usePredicateIndex=usePredicateIndex)
|
usePredicateIndex=usePredicateIndex)
|
||||||
if canListObject(r.first, noSecurityCheck))
|
if canListObject(r.first, noSecurityCheck))
|
||||||
return sorted(rels, key=sort)
|
return sorted(rels, key=sort)
|
||||||
|
|
||||||
def getParents(self, predicates=None, sort='default',
|
def getParents(self, predicates=None, sort='default',
|
||||||
noSecurityCheck=False, usePredicateIndex=False):
|
noSecurityCheck=False, usePredicateIndex=False):
|
||||||
return [r.first for r in self.getParentRelations(
|
return [r.first for r in self.getParentRelations(
|
||||||
predicates, sort=sort,
|
predicates, sort=sort,
|
||||||
noSecurityCheck=noSecurityCheck,
|
noSecurityCheck=noSecurityCheck,
|
||||||
usePredicateIndex=usePredicateIndex)]
|
usePredicateIndex=usePredicateIndex)]
|
||||||
|
|
||||||
def checkPredicate(self, child, predicate=None):
|
def checkPredicate(self, child, predicate=None):
|
||||||
|
@ -317,11 +317,11 @@ class Concept(Contained, Persistent):
|
||||||
IResource.providedBy(r.second))
|
IResource.providedBy(r.second))
|
||||||
return sorted(rels, key=sort)
|
return sorted(rels, key=sort)
|
||||||
|
|
||||||
def getResources(self, predicates=None, sort='default',
|
def getResources(self, predicates=None, sort='default',
|
||||||
noSecurityCheck=False, usePredicateIndex=False):
|
noSecurityCheck=False, usePredicateIndex=False):
|
||||||
return [r.second for r in self.getResourceRelations(
|
return [r.second for r in self.getResourceRelations(
|
||||||
predicates, sort=sort,
|
predicates, sort=sort,
|
||||||
noSecurityCheck=noSecurityCheck,
|
noSecurityCheck=noSecurityCheck,
|
||||||
usePredicateIndex=usePredicateIndex)]
|
usePredicateIndex=usePredicateIndex)]
|
||||||
|
|
||||||
def assignResource(self, resource, predicate=None, order=0, relevance=1.0):
|
def assignResource(self, resource, predicate=None, order=0, relevance=1.0):
|
||||||
|
@ -496,6 +496,8 @@ class IndexAttributes(object):
|
||||||
[v for v in indexValues if v is not None]).strip()
|
[v for v in indexValues if v is not None]).strip()
|
||||||
|
|
||||||
def title(self):
|
def title(self):
|
||||||
|
if self.adaptedIndexAttributes is not None:
|
||||||
|
return self.adaptedIndexAttributes.title()
|
||||||
context = self.context
|
context = self.context
|
||||||
title = context.title
|
title = context.title
|
||||||
if title is None:
|
if title is None:
|
||||||
|
|
Loading…
Add table
Reference in a new issue