-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from makinacorpus/add_catalogs_by_folder
Add catalogs by folder
- Loading branch information
Showing
6 changed files
with
204 additions
and
77 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,12 @@ | ||
from django.conf.urls.defaults import patterns, include, url | ||
from django.views.generic import ListView, TemplateView | ||
from django.conf.urls import patterns, include, url | ||
|
||
from mbtilesmap.models import MBTiles | ||
from mbtilesmap import MBTILES_ID_PATTERN | ||
from mbtilesmap import MBTILES_CATALOG_PATTERN, MBTILES_ID_PATTERN | ||
from .views import index, catalog, preview | ||
|
||
|
||
class MyTemplateView(TemplateView): | ||
def get_context_data(self, **kwargs): | ||
return self.kwargs | ||
|
||
urlpatterns = patterns('', | ||
url(r'^$', | ||
ListView.as_view(queryset=MBTiles.objects.all(), | ||
context_object_name='maps', | ||
template_name='index.html'), | ||
name="index"), | ||
url(r'^(?P<name>%s)/$' % MBTILES_ID_PATTERN, | ||
MyTemplateView.as_view(template_name='map.html'), | ||
name="map"), | ||
url(r'^$', index, name="index"), | ||
url(r'^(?P<catalog>%s)/$' % MBTILES_CATALOG_PATTERN, catalog, name="catalog"), | ||
url(r'^(?P<catalog>%s)/(?P<name>%s)/$' % (MBTILES_CATALOG_PATTERN, MBTILES_ID_PATTERN), preview, name="preview"), | ||
url(r'^', include('mbtilesmap.urls', namespace='mb', app_name='mbtilesmap')), | ||
) |
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
Oops, something went wrong.