'Returns a list of plugin ids matching the given language
ordered by plugin position.'

def get_plugin_tree_order(self, language, parent_id=None):

    plugin_tree_order = self.get_plugins(language).filter(parent=parent_id).order_by('position').values_list('pk', flat=True)
    return list(plugin_tree_order)
