784 rdef.has_perm(self._cw, 'add', **securitycheck_args)) |
784 rdef.has_perm(self._cw, 'add', **securitycheck_args)) |
785 # XXX consider constraint.mainvars to check if constraint apply |
785 # XXX consider constraint.mainvars to check if constraint apply |
786 if vocabconstraints: |
786 if vocabconstraints: |
787 # RQLConstraint is a subclass for RQLVocabularyConstraint, so they |
787 # RQLConstraint is a subclass for RQLVocabularyConstraint, so they |
788 # will be included as well |
788 # will be included as well |
789 restriction += [cstr.restriction for cstr in rdef.constraints |
789 restriction += [cstr.expression for cstr in rdef.constraints |
790 if isinstance(cstr, RQLVocabularyConstraint)] |
790 if isinstance(cstr, RQLVocabularyConstraint)] |
791 else: |
791 else: |
792 restriction += [cstr.restriction for cstr in rdef.constraints |
792 restriction += [cstr.expression for cstr in rdef.constraints |
793 if isinstance(cstr, RQLConstraint)] |
793 if isinstance(cstr, RQLConstraint)] |
794 etypecls = self._cw.vreg['etypes'].etype_class(targettype) |
794 etypecls = self._cw.vreg['etypes'].etype_class(targettype) |
795 rql = etypecls.fetch_rql(self._cw.user, restriction, |
795 rql = etypecls.fetch_rql(self._cw.user, restriction, |
796 mainvar=searchedvar, ordermethod=ordermethod) |
796 mainvar=searchedvar, ordermethod=ordermethod) |
797 # ensure we have an order defined |
797 # ensure we have an order defined |