Skip to content

Commit

Permalink
adapt urls.py to include subclasses of GeoJSONResultLayerData #38
Browse files Browse the repository at this point in the history
  • Loading branch information
nesnoj committed Jun 12, 2019
1 parent eae0882 commit e0ba66e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,16 @@
for name, obj in detail_views_list.items():
if isclass(obj):
if obj.model is not None:
# data detail view
# serial data detail view
if issubclass(obj, views.GeoJSONSingleDatasetLayerView):
single_data_views[obj.model.name] = obj
# data view
# serial data view
elif issubclass(obj, GeoJSONLayerView):
data_views[obj.model.name] = obj
elif getattr(obj, 'model_name', None) is not None:
# serial data result view
if issubclass(obj, views.GeoJSONResultLayerData):
data_views[obj.model_name] = obj
# Append data-views' URLs
urlpatterns.extend(
re_path(r'^{}.data/'.format(name),
Expand Down

0 comments on commit e0ba66e

Please sign in to comment.