Ejemplo n.º 1
0
from geonode.datamanager.models import DataConnection
from geonode.datamanager.utils import testFormhubConnection

from geonode.datamanager.enumerations import ENUMTIMES

from datetime import datetime, timedelta 
from time import time
import json
import cPickle as pickle
import operator
import logging
import zlib

logger = logging.getLogger(__name__)

_extra_context = resolve_extension('extra_context')

DEFAULT_MAPS_SEARCH_BATCH_SIZE = 10


@login_required
def datamanager(request, template='datamanager/datamanager.html', **kw):
    initial_query = request.REQUEST.get('q','')
    dataconnection_objs = DataConnection.objects.all()


    return render_to_response(template, RequestContext(request, {"object_list":dataconnection_objs}))

@login_required
def dataconnection_create(request, template='datamanager/dataconnection_create.html'):
Ejemplo n.º 2
0
date_fmt = lambda dt: dt.isoformat()
USER_DISPLAY = "User"
MAP_DISPLAY = "Map"
LAYER_DISPLAY = "Layer"
DOCUMENT_DISPLAY = "Document"
GROUP_DISPLAY = "Group"

# settings API
search_config = getattr(settings, "SIMPLE_SEARCH_SETTINGS", {})

exclude_patterns = search_config.get("layer_exclusions", [])

exclude_regex = [re.compile(e) for e in exclude_patterns]

process_results = resolve_extension("process_search_results")
if process_results is None:
    process_results = lambda r: r

owner_query = resolve_extension("owner_query")
if not owner_query:
    owner_query = lambda q: Profile.objects.filter(user__isnull=False)

owner_query_fields = resolve_extension("owner_query_fields") or []

layer_query = resolve_extension("layer_query")
if not layer_query:
    layer_query = lambda q: Layer.objects.filter()

map_query = resolve_extension("map_query")
if not map_query:
Ejemplo n.º 3
0
import re

date_fmt = lambda dt: dt.isoformat()
USER_DISPLAY = 'User'
MAP_DISPLAY = 'Map'
LAYER_DISPLAY = 'Layer'
DOCUMENT_DISPLAY = 'Document'

# settings API
search_config = getattr(settings,'SIMPLE_SEARCH_SETTINGS', {})

exclude_patterns = search_config.get('layer_exclusions',[])

exclude_regex = [ re.compile(e) for e in exclude_patterns ]

process_results = resolve_extension('process_search_results')
if process_results is None:
    process_results = lambda r: r

owner_query = resolve_extension('owner_query')
if not owner_query:
    owner_query = lambda q: Profile.objects.filter()

owner_query_fields = resolve_extension('owner_query_fields') or []

layer_query = resolve_extension('layer_query')
if not layer_query:
    layer_query = lambda q: Layer.objects.filter()

map_query = resolve_extension('map_query')
if not map_query: