You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to bottlepy
We are renaming one of our bottle endpoints but need to retain the original name for backwards compatability.
We have found that the following construct works perfectly well but I would like to know if it is safe or if there is a preferred approach:
@service.route("/getdumpdata", method='POST')# New endpoint - to be deprecated eventually @service.route("/getmeta", method='POST')# Original endpoint @serialize @except_errors def dump_data(): ... return api.get_dump_data(...)
Thank you for your help.
Keith
Marcel Hellkamp
unread,
Jan 10, 2018, 5:02:44 AM1/10/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to bott...@googlegroups.com
Hi Keith
yes, this is safe. The decorator just registers the handler function
and does not actually decorate (wrap) it, so chaining is allowed.
Just remember that the order is significant. Since decorators are
applied in reverse order, '/getmeta' will have precedence over
'/getdumpdata' in your example, which is fine since both routes are
unambiguous anyway. Just be careful with ambiguous (overlapping)
routes.