Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds url from controller method to request class #209

Merged
merged 2 commits into from
Jul 1, 2018

Conversation

josephmancuso
Copy link
Member

This adds a new url_from_controller() method.

You can use this like this:

You have multiple routes like so:

from package.controller import Controller

ROUTES = [
    get('/url/route', 'TestController@show'),
    get('/url/controller/@id', Controller.show),
]
from package.controller import Controller

def show(self, request: Request):
    request.url_from_controller('TestController@show') 
    # returns '/url/route'

    request.url_from_controller(Controller.show, {'id': 1}) 
    # returns '/url/controller/1'

@josephmancuso josephmancuso added the next minor Issue scheduled for the next minor release label Jun 30, 2018
@josephmancuso josephmancuso self-assigned this Jun 30, 2018
@coveralls
Copy link

coveralls commented Jun 30, 2018

Coverage Status

Coverage increased (+0.06%) to 91.292% when pulling 973eef1 on add-url-from-controller into 7dbb550 on master.

@josephmancuso josephmancuso added the enhancement New feature or request label Jun 30, 2018
@josephmancuso josephmancuso merged commit f7ca044 into master Jul 1, 2018
@josephmancuso josephmancuso deleted the add-url-from-controller branch July 11, 2018 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request next minor Issue scheduled for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants