helloflask / bootstrap-flask

Bootstrap 4 & 5 helper for your Flask projects.
https://bootstrap-flask.readthedocs.io
Other
1.12k stars 190 forks source link

Examples: macro 'render_table' takes no keyword argument 'urlize_columns' #246

Closed BennyE closed 2 years ago

BennyE commented 2 years ago

Hi bootstrap-flask Team,

It took me a while to understand why a macro that in the text-editor in front of me takes the "urlize_columns" -keyword doesn't actually take it. I guess it is as always: Once you know the reason, it is easy :)

Thank you all for this nice project. I'm still in the discovery phase.

Installation log and backtrace

benny@Bennys-MacBook-Pro python % git clone https://github.com/helloflask/bootstrap-flask.git
Cloning into 'bootstrap-flask'...
remote: Enumerating objects: 2961, done.
remote: Counting objects: 100% (485/485), done.
remote: Compressing objects: 100% (161/161), done.
remote: Total 2961 (delta 360), reused 394 (delta 323), pack-reused 2476
Receiving objects: 100% (2961/2961), 3.30 MiB | 1.28 MiB/s, done.
Resolving deltas: 100% (1801/1801), done.
benny@Bennys-MacBook-Pro python % python3 -m venv bootstrap-flask/.venv
benny@Bennys-MacBook-Pro python % source bootstrap-flask/.venv/bin/activate
(.venv) benny@Bennys-MacBook-Pro python % cd bootstrap-flask 
(.venv) benny@Bennys-MacBook-Pro bootstrap-flask % pip install -r requirements/examples.txt 
Collecting bootstrap-flask==2.0.2
  Using cached Bootstrap_Flask-2.0.2-py2.py3-none-any.whl (3.4 MB)
Collecting click==8.0.3
  Using cached click-8.0.3-py3-none-any.whl (97 kB)
Collecting flask==2.0.2
  Using cached Flask-2.0.2-py3-none-any.whl (95 kB)
Collecting flask-sqlalchemy==2.5.1
  Using cached Flask_SQLAlchemy-2.5.1-py2.py3-none-any.whl (17 kB)
Collecting flask-wtf==1.0.0
  Using cached Flask_WTF-1.0.0-py3-none-any.whl (12 kB)
Collecting itsdangerous==2.0.1
  Using cached itsdangerous-2.0.1-py3-none-any.whl (18 kB)
Collecting jinja2==3.0.2
  Using cached Jinja2-3.0.2-py3-none-any.whl (133 kB)
Collecting markupsafe==2.0.1
  Using cached MarkupSafe-2.0.1.tar.gz (18 kB)
Collecting sqlalchemy==1.4.26
  Using cached SQLAlchemy-1.4.26.tar.gz (7.8 MB)
Collecting werkzeug==2.0.2
  Using cached Werkzeug-2.0.2-py3-none-any.whl (288 kB)
Collecting wtforms==3.0.0
  Using cached WTForms-3.0.0-py3-none-any.whl (136 kB)
Using legacy 'setup.py install' for markupsafe, since package 'wheel' is not installed.
Using legacy 'setup.py install' for sqlalchemy, since package 'wheel' is not installed.
Installing collected packages: markupsafe, wtforms, click, itsdangerous, werkzeug, jinja2, flask, bootstrap-flask, sqlalchemy, flask-sqlalchemy, flask-wtf
    Running setup.py install for markupsafe ... done
    Running setup.py install for sqlalchemy ... done
Successfully installed bootstrap-flask-2.0.2 click-8.0.3 flask-2.0.2 flask-sqlalchemy-2.5.1 flask-wtf-1.0.0 itsdangerous-2.0.1 jinja2-3.0.2 markupsafe-2.0.1 sqlalchemy-1.4.26 werkzeug-2.0.2 wtforms-3.0.0
WARNING: You are using pip version 20.2.3; however, version 22.2.2 is available.
You should consider upgrading via the '/Users/benny/Python/bootstrap-flask/.venv/bin/python3 -m pip install --upgrade pip' command.
(.venv) benny@Bennys-MacBook-Pro bootstrap-flask % cd examples 
(.venv) benny@Bennys-MacBook-Pro examples % python bootstrap5/app.py 
 * Serving Flask app 'app' (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: on
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
 * Restarting with stat
 * Debugger is active!
 * Debugger PIN: xxx-xxx-xxx
127.0.0.1 - - [28/Aug/2022 11:00:17] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [28/Aug/2022 11:00:19] "GET /table HTTP/1.1" 500 -
Traceback (most recent call last):
  File "/Users/benny/Python/bootstrap-flask/.venv/lib/python3.8/site-packages/flask/app.py", line 2091, in __call__
    return self.wsgi_app(environ, start_response)
  File "/Users/benny/Python/bootstrap-flask/.venv/lib/python3.8/site-packages/flask/app.py", line 2076, in wsgi_app
    response = self.handle_exception(e)
  File "/Users/benny/Python/bootstrap-flask/.venv/lib/python3.8/site-packages/flask/app.py", line 2073, in wsgi_app
    response = self.full_dispatch_request()
  File "/Users/benny/Python/bootstrap-flask/.venv/lib/python3.8/site-packages/flask/app.py", line 1518, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/Users/benny/Python/bootstrap-flask/.venv/lib/python3.8/site-packages/flask/app.py", line 1516, in full_dispatch_request
    rv = self.dispatch_request()
  File "/Users/benny/Python/bootstrap-flask/.venv/lib/python3.8/site-packages/flask/app.py", line 1502, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/Users/benny/Python/bootstrap-flask/examples/bootstrap5/app.py", line 190, in test_table
    return render_template('table.html', messages=messages, titles=titles, Message=Message, data=data)
  File "/Users/benny/Python/bootstrap-flask/.venv/lib/python3.8/site-packages/flask/templating.py", line 147, in render_template
    return _render(
  File "/Users/benny/Python/bootstrap-flask/.venv/lib/python3.8/site-packages/flask/templating.py", line 128, in _render
    rv = template.render(context)
  File "/Users/benny/Python/bootstrap-flask/.venv/lib/python3.8/site-packages/jinja2/environment.py", line 1304, in render
    self.environment.handle_exception()
  File "/Users/benny/Python/bootstrap-flask/.venv/lib/python3.8/site-packages/jinja2/environment.py", line 925, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "/Users/benny/Python/bootstrap-flask/examples/bootstrap5/templates/table.html", line 2, in top-level template code
    {% from 'bootstrap5/table.html' import render_table %}
  File "/Users/benny/Python/bootstrap-flask/examples/bootstrap5/templates/base.html", line 51, in top-level template code
    {% block content %}{% endblock %}
  File "/Users/benny/Python/bootstrap-flask/examples/bootstrap5/templates/table.html", line 23, in block 'content'
    {{ render_table(messages, urlize_columns=('text'), show_actions=True, model=Message,
TypeError: macro 'render_table' takes no keyword argument 'urlize_columns'

Reason

bootstrap-flask/requirements/examples.txt pins to 2.0.2 but requires 2.1.0