'Returns currently set Perspective for the Group'

def get_perspective(self):

    ids = []
    try:
        for setting in ModuleSetting.get_for_module('treeio.core', name='default_perspective', group=self):
            ids.append(long(setting.value))
        _id = ids[0]
        perspective = get_object_or_404(Perspective, pk=_id)
    except:
        try:
            conf = ModuleSetting.get_for_module('treeio.core', 'default_perspective')[0]
            perspective = Perspective.objects.get(pk=long(conf.value))
        except:
            try:
                perspective = Perspective.objects.all()[0]
                ModuleSetting.set_for_module('default_perspective', perspective.id, 'treeio.core', group=self)
            except:
                raise Perspective.DoesNotExist('No    Perspective    exists')
    return perspective
