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

@route('/view/file/<int:file_id>', methods=['GET']) generates error #44

Closed
xingshou opened this issue Mar 28, 2017 · 2 comments
Closed

Comments

@xingshou
Copy link

If I remove 'int:' from the route string, it works as expected, but I want to specify parameter types as the same way flask's own route() does.
Doesn't flask-classful support argument type such as int:file_id? Or does it provide any other way to specify parameter types?

Sungsoo Kim

Traceback (most recent call last):
  File "manage.py", line 62, in <module>
    manager.run()
  File "/Users/sungsoo/.pyenv/versions/3.5.2/envs/cms/lib/python3.5/site-packages/flask_script/__init__.py", line 412, in run
    result = self.handle(sys.argv[0], sys.argv[1:])
  File "/Users/sungsoo/.pyenv/versions/3.5.2/envs/cms/lib/python3.5/site-packages/flask_script/__init__.py", line 383, in handle
    res = handle(*args, **config)
  File "/Users/sungsoo/.pyenv/versions/3.5.2/envs/cms/lib/python3.5/site-packages/flask_script/commands.py", line 216, in __call__
    return self.run(*args, **kwargs)
  File "manage.py", line 30, in list_routes
    url = url_for(rule.endpoint, **options)
  File "/Users/sungsoo/.pyenv/versions/3.5.2/envs/cms/lib/python3.5/site-packages/flask/helpers.py", line 323, in url_for
    force_external=external)
  File "/Users/sungsoo/.pyenv/versions/3.5.2/envs/cms/lib/python3.5/site-packages/werkzeug/routing.py", line 1756, in build
    rv = self._partial_build(endpoint, values, method, append_unknown)
  File "/Users/sungsoo/.pyenv/versions/3.5.2/envs/cms/lib/python3.5/site-packages/werkzeug/routing.py", line 1671, in _partial_build
    append_unknown)
  File "/Users/sungsoo/.pyenv/versions/3.5.2/envs/cms/lib/python3.5/site-packages/werkzeug/routing.py", line 1679, in _partial_build
    rv = rule.build(values, append_unknown)
  File "/Users/sungsoo/.pyenv/versions/3.5.2/envs/cms/lib/python3.5/site-packages/werkzeug/routing.py", line 798, in build
    add(self._converters[data].to_url(values[data]))
  File "/Users/sungsoo/.pyenv/versions/3.5.2/envs/cms/lib/python3.5/site-packages/werkzeug/routing.py", line 1016, in to_url
    value = self.num_convert(value)
ValueError: invalid literal for int() with base 10: '[queue_id]'
@xingshou
Copy link
Author

Sorry, it may not be from flask-classful. I will check-up other things and report the result.

Thanks!

@xingshou
Copy link
Author

I have used a helper at http://flask.pocoo.org/snippets/117/ to list routes. It has a problem, not flask-classful.

Just ignore this issue!

Thanks!

@hoatle hoatle closed this as completed Mar 28, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

2 participants