From f2dbce73ad38b89b042afc00215dd589f429b646 Mon Sep 17 00:00:00 2001 From: Sanj Date: Sun, 28 Aug 2011 03:44:32 +0530 Subject: [PATCH] added basic structure for urls and views --- gazetteer/places/views.py | 19 +++++++++++++++++++ gazetteer/settings.py | 2 +- gazetteer/static/js/gazetteer.js | 5 +++++ gazetteer/urls.py | 5 ++++- 4 files changed, 29 insertions(+), 2 deletions(-) diff --git a/gazetteer/places/views.py b/gazetteer/places/views.py index 60f00ef..9fda4e1 100644 --- a/gazetteer/places/views.py +++ b/gazetteer/places/views.py @@ -1 +1,20 @@ # Create your views here. +from django.shortcuts import render_to_response +from ox.django.shortcuts import render_to_json_response +from django.template import RequestContext + +def search(request): + d = RequestContext(request, {}) + return render_to_response("search.html", d) + +def search_json(request): + d = {} + return render_to_json_response(d) + +def search_related(request): + d = RequestContext(request, {}) + return render_to_response("search_related.html") + +def search_related_json(request): + d = {} + return render_to_json_response(d) diff --git a/gazetteer/settings.py b/gazetteer/settings.py index 65b6478..39f22c1 100644 --- a/gazetteer/settings.py +++ b/gazetteer/settings.py @@ -4,7 +4,7 @@ from os.path import join DEBUG = True TEMPLATE_DEBUG = DEBUG -DATA_DIR = '/home/sanj/c/gazetteer/data' +# DATA_DIR = '/home/sanj/c/gazetteer/data' ADMINS = ( # ('Your Name', 'your_email@domain.com'), ) diff --git a/gazetteer/static/js/gazetteer.js b/gazetteer/static/js/gazetteer.js index e69de29..4f28875 100644 --- a/gazetteer/static/js/gazetteer.js +++ b/gazetteer/static/js/gazetteer.js @@ -0,0 +1,5 @@ +$(function() { + var map = new OpenLayers.Map('map', {}); + + +}); diff --git a/gazetteer/urls.py b/gazetteer/urls.py index 9763cba..75c15db 100644 --- a/gazetteer/urls.py +++ b/gazetteer/urls.py @@ -7,7 +7,10 @@ admin.autodiscover() urlpatterns = patterns('', # Example: # (r'^gazetteer/', include('gazetteer.foo.urls')), - + ('^search$', 'places.views.search'), + ('^search_json$', 'places.views.search_json'), + ('^search_related$', 'places.views.search_related'), + ('^search_related_json$', 'places.views.search_related.json'), # Uncomment the admin/doc line below to enable admin documentation: (r'^admin/doc/', include('django.contrib.admindocs.urls')),