Skip to content

Commit

Permalink
remove the /slice/id/ endpoint in preference of /datasource_type/data…
Browse files Browse the repository at this point in the history
…source_id/slice_id/
  • Loading branch information
williaster committed Aug 31, 2016
1 parent 1f70544 commit 35acfd9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
13 changes: 0 additions & 13 deletions caravel/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1255,19 +1255,6 @@ def favstar(self, class_name, obj_id, action):
json.dumps({'count': count}),
mimetype="application/json")

@has_access
@expose("/slice/<slice_id>/")
def slice(self, slice_id):
"""Convenience method for viewing a slice from its id alone"""
session = db.session()
qry = session.query(models.Slice).filter_by(id=int(slice_id))
slc = qry.first()
if slc:
return self.explore(slc.datasource_type, slc.datasource_id, slice_id=slice_id)
else:
flash("The specified slice could not be found", "danger")
return redirect('/slicemodelview/list/')

@has_access
@expose("/dashboard/<dashboard_id>/")
def dashboard(self, dashboard_id):
Expand Down
5 changes: 2 additions & 3 deletions tests/core_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,10 @@ def test_slices(self):
for slc in db.session.query(Slc).all():
urls += [
(slc.slice_name, 'slice_url', slc.slice_url),
(slc.slice_name, 'slice_id_endpoint', '/caravel/slices/{}'.
format(slc.id)),
(slc.slice_name, 'json_endpoint', slc.viz.json_endpoint),
(slc.slice_name, 'csv_endpoint', slc.viz.csv_endpoint),
(slc.slice_name, 'slice_id_url', "/caravel/slice/{slc.id}/".format(slc=slc)),
(slc.slice_name, 'slice_id_url',
"/caravel/{slc.datasource_type}/{slc.datasource_id}/{slc.id}/".format(slc=slc)),
]
for name, method, url in urls:
print("[{name}]/[{method}]: {url}".format(**locals()))
Expand Down

0 comments on commit 35acfd9

Please sign in to comment.