get / edit stop
This commit is contained in:
parent
ebdb732921
commit
be8376c8fa
|
@ -3,4 +3,5 @@ import apiviews
|
||||||
|
|
||||||
urlpatterns = patterns('',
|
urlpatterns = patterns('',
|
||||||
(r'^route/(?P<alias>.*)$', apiviews.route), #FIXME: better regexp for route alias?
|
(r'^route/(?P<alias>.*)$', apiviews.route), #FIXME: better regexp for route alias?
|
||||||
|
(r'^stop/(?P<id>[0-9]*)$', apiviews.stop),
|
||||||
)
|
)
|
||||||
|
|
|
@ -14,9 +14,14 @@ def route(request, alias):
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@login_required(request, id):
|
|
||||||
|
def stop:(request, id):
|
||||||
|
if request.POST:
|
||||||
if not id:
|
if not id:
|
||||||
stop = Stop() #FIXME: should this return an error instead?
|
stop = Stop() #FIXME: should this return an error instead?
|
||||||
else:
|
else:
|
||||||
stop = get_object_or_404_json(Stop, id=id)
|
stop = get_object_or_404_json(Stop, id=id)
|
||||||
return stop.from_geojson(request.POST)
|
return stop.from_geojson(request.POST)
|
||||||
|
else:
|
||||||
|
stop = get_object_or_404_json(Stop, id=id)
|
||||||
|
return stop.get_geojson()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user