fix check for predicate option
This commit is contained in:
parent
26ef8449b5
commit
0c601f373b
4 changed files with 23 additions and 4 deletions
|
@ -311,7 +311,8 @@ class ConceptView(BaseView):
|
||||||
break
|
break
|
||||||
if skip:
|
if skip:
|
||||||
continue
|
continue
|
||||||
if IOptions(adapted(r.predicate))('hide_children'):
|
options = IOptions(adapted(r.predicate), None)
|
||||||
|
if options is not None and options('hide_children'):
|
||||||
continue
|
continue
|
||||||
if fv.check(r.context):
|
if fv.check(r.context):
|
||||||
yield r
|
yield r
|
||||||
|
|
15
external/README.txt
vendored
15
external/README.txt
vendored
|
@ -54,6 +54,19 @@ Creating the corresponding objects
|
||||||
>>> adMyquery.options
|
>>> adMyquery.options
|
||||||
[u'option1', u'option2']
|
[u'option1', u'option2']
|
||||||
|
|
||||||
|
Importing types
|
||||||
|
---------------
|
||||||
|
|
||||||
|
>>> input = ("type('mytype', u'My Type',"
|
||||||
|
... " typeInterface='loops.expert.concept.IQueryConcept')")
|
||||||
|
>>> reader = PyReader()
|
||||||
|
>>> elements = reader.read(input)
|
||||||
|
>>> loader = Loader(loopsRoot)
|
||||||
|
>>> loader.load(elements)
|
||||||
|
|
||||||
|
>>> adapted(concepts['mytype']).typeInterface
|
||||||
|
<InterfaceClass loops.expert.concept.IQueryConcept>
|
||||||
|
|
||||||
Working with resources
|
Working with resources
|
||||||
----------------------
|
----------------------
|
||||||
|
|
||||||
|
@ -118,7 +131,7 @@ Extracting elements
|
||||||
>>> extractor = Extractor(loopsRoot, os.path.join(dataDirectory, 'export'))
|
>>> extractor = Extractor(loopsRoot, os.path.join(dataDirectory, 'export'))
|
||||||
>>> elements = list(extractor.extract())
|
>>> elements = list(extractor.extract())
|
||||||
>>> len(elements)
|
>>> len(elements)
|
||||||
52
|
53
|
||||||
|
|
||||||
Writing object information to the external storage
|
Writing object information to the external storage
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
|
|
3
external/element.py
vendored
3
external/element.py
vendored
|
@ -126,6 +126,9 @@ class TypeElement(ConceptElement):
|
||||||
loader.typeConcept, **kw)
|
loader.typeConcept, **kw)
|
||||||
instance = self.getInstance(omit=['title', 'typeInterface'])
|
instance = self.getInstance(omit=['title', 'typeInterface'])
|
||||||
formState = instance.applyTemplate(data=kw, ignoreValidation=True)
|
formState = instance.applyTemplate(data=kw, ignoreValidation=True)
|
||||||
|
if ti:
|
||||||
|
# overwrite type interface, might have been ignored in addConcept
|
||||||
|
adapted(self.object).typeInterface = kw['typeInterface']
|
||||||
|
|
||||||
|
|
||||||
class ChildElement(Element):
|
class ChildElement(Element):
|
||||||
|
|
|
@ -74,7 +74,8 @@ class MemberRegistrationManager(object):
|
||||||
self.createPrincipal(pfName, userId, password, lastName, firstName)
|
self.createPrincipal(pfName, userId, password, lastName, firstName)
|
||||||
groups = options(self.groups_key, ())
|
groups = options(self.groups_key, ())
|
||||||
self.setGroupsForPrincipal(pfName, userId, groups=groups)
|
self.setGroupsForPrincipal(pfName, userId, groups=groups)
|
||||||
self.createPersonForPrincipal(self, pfName, userId, lastName, firstName=firstName, useExisting=useExisting, **kw)
|
self.createPersonForPrincipal(pfName, userId, lastName, firstName,
|
||||||
|
useExisting, **kw)
|
||||||
|
|
||||||
def createPrincipal(self, pfName, userId, password, lastName,
|
def createPrincipal(self, pfName, userId, password, lastName,
|
||||||
firstName=u'', groups=[], useExisting=False, **kw):
|
firstName=u'', groups=[], useExisting=False, **kw):
|
||||||
|
@ -109,7 +110,8 @@ class MemberRegistrationManager(object):
|
||||||
members.append(pFolder.prefix + userId)
|
members.append(pFolder.prefix + userId)
|
||||||
group.principals = members
|
group.principals = members
|
||||||
|
|
||||||
def createPersonForPrincipal(self, pfName, userId, lastName, firstName=u'', useExisting=False, **kw):
|
def createPersonForPrincipal(self, pfName, userId, lastName, firstName=u'',
|
||||||
|
useExisting=False, **kw):
|
||||||
concepts = self.context.getConceptManager()
|
concepts = self.context.getConceptManager()
|
||||||
personType = adapted(concepts[self.person_typeName])
|
personType = adapted(concepts[self.person_typeName])
|
||||||
pFolder = getPrincipalFolder(self.context, pfName)
|
pFolder = getPrincipalFolder(self.context, pfName)
|
||||||
|
|
Loading…
Add table
Reference in a new issue