How to use the cartoview.app_manager.models.App.objects function in cartoview

To help you get started, we’ve selected a few cartoview examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cartologic / cartoview / cartoview / app_manager / templatetags / base_tags.py View on Github external
if facet_type == 'layers':
            return facets

        maps = Map.objects.filter(title__icontains=title_filter)
        documents = Document.objects.filter(title__icontains=title_filter)

        if not settings.SKIP_PERMS_FILTER:
            maps = maps.filter(id__in=authorized)
            documents = documents.filter(id__in=authorized)

        facets['map'] = maps.count()
        facets['document'] = documents.count()
        if facet_type == 'home':
            facets['user'] = get_user_model().objects.exclude(
                username='AnonymousUser').count()
            facets['app'] = App.objects.count()
            facets['group'] = GroupProfile.objects.exclude(
                access="private").count()

            facets['layer'] = facets['raster'] + \
                facets['vector'] + facets['remote']

    return facets
github cartologic / cartoview / cartoview / app_manager / installer.py View on Github external
angular.forEach(app.store.installedApps.objects,
         function(installedApp{
                var currentApp = appsHash[installedApp.name];
                if(dependents.indexOf(currentApp) == -1 &&
                 currentApp.latest_version.dependencies[app.name]){
                    dependents.push(currentApp)
                    _getDependents(currentApp, appsHash, dependents)
                }

            });

        :return:
        """
        with lock:
            uninstalled = False
            installed_apps = App.objects.all()
            for app in installed_apps:
                app_installer = AppInstaller(
                    app.name, self.store.id, app.version, user=self.user)
                dependencies = self.version.dependencies.get_attributes() \
                    if app_installer.version else {}
                if self.name in dependencies.keys():
                    app_installer.uninstall(restart=False)
            self.completely_remove()
            uninstalled = True
            if restart:
                RestartHelper.restart_server()
            return uninstalled
github cartologic / cartoview / cartoview / templatetags / cartoview_tags.py View on Github external
if facet_type == 'layers':
            return facets

        maps = Map.objects.filter(title__icontains=title_filter)
        documents = Document.objects.filter(title__icontains=title_filter)

        if not settings.SKIP_PERMS_FILTER:
            maps = maps.filter(id__in=authorized)
            documents = documents.filter(id__in=authorized)

        facets['map'] = maps.count()
        facets['document'] = documents.count()
        if facet_type == 'home':
            facets['user'] = get_user_model().objects.exclude(
                username='AnonymousUser').count()
            facets['app'] = App.objects.count()
            facets['group'] = GroupProfile.objects.exclude(
                access="private").count()

            facets['layer'] = facets['raster'] + \
            facets['vector'] + facets['remote']

    return facets
github cartologic / cartoview / cartoview / app_manager / context_processors.py View on Github external
def apps(request):
    return {'apps': App.objects.all().order_by('order')}