-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'add-django-1.8-testing'
- Loading branch information
Showing
24 changed files
with
150 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import django | ||
from django.template import Library | ||
|
||
if django.get_version() >= '1.5': | ||
from django.template.defaulttags import url as django_url | ||
else: | ||
from django.templatetags.future import url as django_url | ||
|
||
register = Library() | ||
|
||
@register.tag | ||
def url(parser, token): | ||
return django_url(parser, token) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,58 @@ | ||
from django.conf.urls import patterns, include | ||
from django.conf.urls import include, url | ||
from django.conf import settings | ||
from django.shortcuts import render | ||
|
||
from mapit.shortcuts import render | ||
from mapit.views import areas, postcodes | ||
|
||
handler500 = 'mapit.shortcuts.json_500' | ||
|
||
format_end = '(?:\.(?P<format>html|json))?' | ||
|
||
urlpatterns = patterns( | ||
'', | ||
(r'^$', render, {'template_name': 'mapit/index.html'}, 'mapit_index'), | ||
(r'^licensing$', render, {'template_name': 'mapit/licensing.html'}), | ||
(r'^overview$', render, {'template_name': 'mapit/overview.html'}), | ||
|
||
(r'^generations%s$' % format_end, 'mapit.views.areas.generations', {}, 'mapit_generations'), | ||
|
||
(r'^postcode/$', 'mapit.views.postcodes.form_submitted'), | ||
(r'^postcode/(?P<postcode>[A-Za-z0-9 +]+)%s$' % format_end, 'mapit.views.postcodes.postcode'), | ||
(r'^postcode/partial/(?P<postcode>[A-Za-z0-9 ]+)%s$' % format_end, 'mapit.views.postcodes.partial_postcode'), | ||
|
||
(r'^area/(?P<area_id>[0-9A-Z]+)%s$' % format_end, 'mapit.views.areas.area'), | ||
(r'^area/(?P<area_id>[0-9]+)/example_postcode%s$' % format_end, 'mapit.views.postcodes.example_postcode_for_area'), | ||
(r'^area/(?P<area_id>[0-9]+)/children%s$' % format_end, 'mapit.views.areas.area_children'), | ||
(r'^area/(?P<area_id>[0-9]+)/geometry$', 'mapit.views.areas.area_geometry'), | ||
(r'^area/(?P<area_id>[0-9]+)/touches%s$' % format_end, 'mapit.views.areas.area_touches'), | ||
(r'^area/(?P<area_id>[0-9]+)/overlaps%s$' % format_end, 'mapit.views.areas.area_overlaps'), | ||
(r'^area/(?P<area_id>[0-9]+)/covers%s$' % format_end, 'mapit.views.areas.area_covers'), | ||
(r'^area/(?P<area_id>[0-9]+)/covered%s$' % format_end, 'mapit.views.areas.area_covered'), | ||
(r'^area/(?P<area_id>[0-9]+)/coverlaps%s$' % format_end, 'mapit.views.areas.area_coverlaps'), | ||
(r'^area/(?P<area_id>[0-9]+)/intersects%s$' % format_end, 'mapit.views.areas.area_intersects'), | ||
(r'^area/(?P<area_id>[0-9A-Z]+)\.(?P<format>kml|geojson|wkt)$', 'mapit.views.areas.area_polygon'), | ||
(r'^area/(?P<srid>[0-9]+)/(?P<area_id>[0-9]+)\.(?P<format>kml|json|geojson|wkt)$', | ||
'mapit.views.areas.area_polygon'), | ||
|
||
(r'^point/$', 'mapit.views.areas.point_form_submitted'), | ||
(r'^point/(?P<srid>[0-9]+)/(?P<x>[0-9.-]+),(?P<y>[0-9.-]+)(?:/(?P<bb>box))?%s$' % format_end, | ||
'mapit.views.areas.areas_by_point'), | ||
(r'^point/latlon/(?P<lat>[0-9.-]+),(?P<lon>[0-9.-]+)(?:/(?P<bb>box))?%s$' % format_end, | ||
'mapit.views.areas.areas_by_point_latlon'), | ||
(r'^point/osgb/(?P<e>[0-9.-]+),(?P<n>[0-9.-]+)(?:/(?P<bb>box))?%s$' % format_end, | ||
'mapit.views.areas.areas_by_point_osgb'), | ||
|
||
(r'^nearest/(?P<srid>[0-9]+)/(?P<x>[0-9.-]+),(?P<y>[0-9.-]+)%s$' % format_end, 'mapit.views.postcodes.nearest'), | ||
|
||
(r'^areas/(?P<area_ids>[0-9]+(?:,[0-9]+)*)%s$' % format_end, 'mapit.views.areas.areas'), | ||
(r'^areas/(?P<area_ids>[0-9]+(?:,[0-9]+)*)/geometry$', 'mapit.views.areas.areas_geometry'), | ||
(r'^areas/(?P<type>[A-Z0-9,]*[A-Z0-9]+)%s$' % format_end, 'mapit.views.areas.areas_by_type'), | ||
(r'^areas/(?P<name>.+?)%s$' % format_end, 'mapit.views.areas.areas_by_name'), | ||
(r'^areas$', 'mapit.views.areas.deal_with_POST', {'call': 'areas'}), | ||
(r'^code/(?P<code_type>[^/]+)/(?P<code_value>[^/]+?)%s$' % format_end, 'mapit.views.areas.area_from_code'), | ||
) | ||
urlpatterns = [ | ||
url(r'^$', render, {'template_name': 'mapit/index.html'}, 'mapit_index'), | ||
url(r'^licensing$', render, {'template_name': 'mapit/licensing.html'}), | ||
url(r'^overview$', render, {'template_name': 'mapit/overview.html'}), | ||
|
||
url(r'^generations%s$' % format_end, areas.generations, {}, 'mapit_generations'), | ||
|
||
url(r'^postcode/$', postcodes.form_submitted), | ||
url(r'^postcode/(?P<postcode>[A-Za-z0-9 +]+)%s$' % format_end, postcodes.postcode, name="mapit-postcode"), | ||
url(r'^postcode/partial/(?P<postcode>[A-Za-z0-9 ]+)%s$' % format_end, postcodes.partial_postcode, name="mapit-postcode-partial"), | ||
|
||
url(r'^area/(?P<area_id>[0-9A-Z]+)%s$' % format_end, areas.area), | ||
url(r'^area/(?P<area_id>[0-9]+)/example_postcode%s$' % format_end, postcodes.example_postcode_for_area), | ||
url(r'^area/(?P<area_id>[0-9]+)/children%s$' % format_end, areas.area_children), | ||
url(r'^area/(?P<area_id>[0-9]+)/geometry$', areas.area_geometry), | ||
url(r'^area/(?P<area_id>[0-9]+)/touches%s$' % format_end, areas.area_touches), | ||
url(r'^area/(?P<area_id>[0-9]+)/overlaps%s$' % format_end, areas.area_overlaps), | ||
url(r'^area/(?P<area_id>[0-9]+)/covers%s$' % format_end, areas.area_covers), | ||
url(r'^area/(?P<area_id>[0-9]+)/covered%s$' % format_end, areas.area_covered), | ||
url(r'^area/(?P<area_id>[0-9]+)/coverlaps%s$' % format_end, areas.area_coverlaps), | ||
url(r'^area/(?P<area_id>[0-9]+)/intersects%s$' % format_end, areas.area_intersects), | ||
url(r'^area/(?P<area_id>[0-9A-Z]+)\.(?P<format>kml|geojson|wkt)$', areas.area_polygon), | ||
url(r'^area/(?P<srid>[0-9]+)/(?P<area_id>[0-9]+)\.(?P<format>kml|json|geojson|wkt)$', | ||
areas.area_polygon), | ||
|
||
url(r'^point/$', areas.point_form_submitted), | ||
url(r'^point/(?P<srid>[0-9]+)/(?P<x>[0-9.-]+),(?P<y>[0-9.-]+)(?:/(?P<bb>box))?%s$' % format_end, | ||
areas.areas_by_point), | ||
url(r'^point/latlon/(?P<lat>[0-9.-]+),(?P<lon>[0-9.-]+)(?:/(?P<bb>box))?%s$' % format_end, | ||
areas.areas_by_point_latlon), | ||
url(r'^point/osgb/(?P<e>[0-9.-]+),(?P<n>[0-9.-]+)(?:/(?P<bb>box))?%s$' % format_end, | ||
areas.areas_by_point_osgb), | ||
|
||
url(r'^nearest/(?P<srid>[0-9]+)/(?P<x>[0-9.-]+),(?P<y>[0-9.-]+)%s$' % format_end, postcodes.nearest), | ||
|
||
url(r'^areas/(?P<area_ids>[0-9]+(?:,[0-9]+)*)%s$' % format_end, areas.areas), | ||
url(r'^areas/(?P<area_ids>[0-9]+(?:,[0-9]+)*)/geometry$', areas.areas_geometry), | ||
url(r'^areas/(?P<type>[A-Z0-9,]*[A-Z0-9]+)%s$' % format_end, areas.areas_by_type), | ||
url(r'^areas/(?P<name>.+?)%s$' % format_end, areas.areas_by_name), | ||
url(r'^areas$', areas.deal_with_POST, {'call': 'areas'}), | ||
url(r'^code/(?P<code_type>[^/]+)/(?P<code_value>[^/]+?)%s$' % format_end, areas.area_from_code), | ||
] | ||
|
||
# Include app-specific urls | ||
if (settings.MAPIT_COUNTRY == 'GB'): | ||
urlpatterns += patterns( | ||
'', (r'^', include('mapit_gb.urls')), | ||
urlpatterns.append( | ||
url(r'^', include('mapit_gb.urls')), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.