コード例 #1
0
ファイル: extension.py プロジェクト: nastasi-oq/geonode
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:
コード例 #2
0
from geonode.search.util import resolve_extension
from geonode.search.normalizers import apply_normalizers
from geonode.search.query import query_from_request
from geonode.search.query import BadQuery

from datetime import datetime
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


def _create_viewer_config():
    DEFAULT_MAP_CONFIG, DEFAULT_BASE_LAYERS = default_map_config()
    _map = Map(projection="EPSG:900913", zoom=1, center_x=0, center_y=0)
    return json.dumps(_map.viewer_json(*DEFAULT_BASE_LAYERS))


_viewer_config = _create_viewer_config()


def search_page(request, template='search/search.html', **kw):
    results, facets, query = search_api(request, format='html', **kw)
コード例 #3
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'):
コード例 #4
0
ファイル: extension.py プロジェクト: pop2pop/geonode
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: