(self, portal_type=None, collect_order_group=None,
                            **kw)
return sorted(movement_group_list, sort_movement_group)
Return a list of movement groups sorted by collect order group and index.
Return a list of movement groups sorted by collect order group and index.
Return a list of movement groups sorted by collect order group and index .
def getMovementGroupList(self, portal_type=None, collect_order_group=None,
                            **kw):
    """
    Return a list of movement groups sorted by collect order group and index.
    """
    category_index_dict = {}
    for i in self.getPortalObject().portal_categories.collect_order_group.contentValues():
      category_index_dict[i.getId()] = i.getIntIndex()

    def sort_movement_group(a, b):
      return cmp(category_index_dict.get(a.getCollectOrderGroup()),
                 category_index_dict.get(b.getCollectOrderGroup())) or \
             cmp(a.getIntIndex(), b.getIntIndex())
    if portal_type is None:
      portal_type = self.getPortalMovementGroupTypeList()
    movement_group_list = [x for x in self.contentValues(filter={'portal_type': portal_type}) \
                           if collect_order_group is None or collect_order_group == x.getCollectOrderGroup()]
    return sorted(movement_group_list, sort_movement_group)
def getMovementGroupList ( self , portal_type = None , collect_order_group = None , * * kw ) : category_index_dict = { } for i in self . getPortalObject ( ) . portal_categories . collect_order_group . contentValues ( ) : category_index_dict [ i . getId ( ) ] = i . getIntIndex ( ) def sort_movement_group ( a , b ) : return cmp ( category_index_dict . get ( a . getCollectOrderGroup ( ) ) , category_index_dict . get ( b . getCollectOrderGroup ( ) ) ) or cmp ( a . getIntIndex ( ) , b . getIntIndex ( ) ) if portal_type is None : portal_type = self . getPortalMovementGroupTypeList ( ) movement_group_list = [ x for x in self . contentValues ( filter = { 'portal_type' : portal_type } ) if collect_order_group is None or collect_order_group == x . getCollectOrderGroup ( ) ] return sorted ( movement_group_list , sort_movement_group )