def _rcmp(x,y): r = Es.relation_cmp_until(y,x) if r: return r r = cmp(unicode(x['how'].humanName) if x['how'] else None, unicode(y['how'].humanName) if y['how'] else None) if r: return r r = cmp(unicode(x['who'].humanName), unicode(y['who'].humanName)) if r: return r return Es.relation_cmp_from(x,y)
def _cmp(x,y): r = Es.relation_cmp_until(y,x) if r: return r r = cmp(unicode(x['with'].humanName), unicode(y['with'].humanName)) if r: return r r = cmp(unicode(x['who'].humanName), unicode(y['who'].humanName)) if r: return r return Es.relation_cmp_from(x,y)
def _cmp(x, y): r = Es.relation_cmp_until(y, x) if r: return r r = cmp(unicode(x["with"].humanName), unicode(y["with"].humanName)) if r: return r r = cmp(unicode(x["how"].humanName) if x["how"] else None, unicode(y["how"].humanName) if y["how"] else None) if r: return r return Es.relation_cmp_from(x, y)