Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
url_for api generated endpoints #274
I needed to create a custom route for some complex logic in the app, I am actually returning a 303 since the endpoint performs an update on another object. A 303 is supposed to return a location for the browser or client to know the url of the updated resource, which they can then use to request the object, if needed.
I would like to return the url of the updated object and thought it would be nice to have a shortcut to the GET SINGLE url for the resource. How do you normally refer to your endpoint urls when referring to them throughout your app? Typing them out is simple enough, but if the urls change, whether via an updated prefix or perhaps a model name change, it would be nice if I could simply refer to the endpoint by name and pass in the id, eg api_endpoint(people_get_single, 1).
I think this would be a fabulous feature. Unfortunately, I'm not really sure where to start, since all the state is maintained in the
+1 this feature.
@jfinkels wouldn't accessing this information be relatively straight forward? It seems we would just need to expose some methods on https://github.com/jfinkels/flask-restless/blob/master/flask_restless/manager.py#L33. The part that is confusing me is how we would provide an endpoint to the