equal
deleted
inserted
replaced
369 |
369 |
370 from cubicweb.server import rqlannotation |
370 from cubicweb.server import rqlannotation |
371 _orig_select_principal = rqlannotation._select_principal |
371 _orig_select_principal = rqlannotation._select_principal |
372 |
372 |
373 def _select_principal(scope, relations): |
373 def _select_principal(scope, relations): |
|
374 def sort_key(something): |
|
375 try: |
|
376 return something.r_type |
|
377 except AttributeError: |
|
378 return (something[0].r_type, something[1]) |
374 return _orig_select_principal(scope, relations, |
379 return _orig_select_principal(scope, relations, |
375 _sort=lambda rels: sorted(rels, key=lambda x: x.r_type)) |
380 _sort=lambda rels: sorted(rels, key=sort_key)) |
376 |
381 |
377 try: |
382 try: |
378 from cubicweb.server.msplanner import PartPlanInformation |
383 from cubicweb.server.msplanner import PartPlanInformation |
379 except ImportError: |
384 except ImportError: |
380 class PartPlanInformation(object): |
385 class PartPlanInformation(object): |