equal
deleted
inserted
replaced
314 if value is None or unicode(value) == u'': |
314 if value is None or unicode(value) == u'': |
315 mainattr = 'eid' |
315 mainattr = 'eid' |
316 path += '/eid' |
316 path += '/eid' |
317 elif needcheck: |
317 elif needcheck: |
318 # make sure url is not ambiguous |
318 # make sure url is not ambiguous |
319 rql = 'Any COUNT(X) WHERE X is %s, X %s %%(value)s' % ( |
319 try: |
320 etype, mainattr) |
320 nbresults = self.__unique |
321 nbresults = self._cw.execute(rql, {'value' : value})[0][0] |
321 except AttributeError: |
|
322 rql = 'Any COUNT(X) WHERE X is %s, X %s %%(value)s' % ( |
|
323 etype, mainattr) |
|
324 nbresults = self.__unique = self._cw.execute(rql, {'value' : value})[0][0] |
322 if nbresults != 1: # ambiguity? |
325 if nbresults != 1: # ambiguity? |
323 mainattr = 'eid' |
326 mainattr = 'eid' |
324 path += '/eid' |
327 path += '/eid' |
325 if mainattr == 'eid': |
328 if mainattr == 'eid': |
326 if use_ext_eid: |
329 if use_ext_eid: |