iurisilvio/bottle-sqlalchemy — pull request #10 by fredj (2012-09-18 11:30:43+00:00)
Title: Plugin name depends on keyword

The following code raises a `TypeError: index() takes exactly 2 arguments (1 given)`:
```python
from sqlalchemy import create_engine
from bottle.ext import sqlalchemy
from bottle import Bottle

app = Bottle()

p1 = sqlalchemy.Plugin(create_engine(...), keyword='a')
p2 = sqlalchemy.Plugin(create_engine(...), keyword='b')

app.install(p1)
app.install(p2)

@app.get('/')
def index(a, b):
return 'ok'
```

Because the two plugins have the same name ('sqlalchemy'), the first one is not applied by bottle and the 'a' parameter is not set.

This use case is covered in the unit tests (test_install_conflicts) and the workaround is to change the plugin name.

This pull request suggest to make the plugin name dynamic and depends on the keyword.