url_for is a helper declared in the RhoController class, so it's only available inside controller methods. There are two things you can do if you need to set a callback from somewhere else:
- call url_for in a controller and pass the result as a parameter to your module. This would be the preferred approach, as it will make different parts of your code more decoupled from each other.
- you can simply hardcode the url and use "/app/MyController/mycallback". It's not particularly elegant, but it will work.