> It looks like the `future` flag on Engine and the `future` flag on 
Session are two separate things.  So you need to add `future=True` to 
either sessionmaker or the Session constructor.

Confirming this.  There is also a `future` on `Connection` objects, but 
that is inherited from `Engine`.  Session and Engine/Connection are 
entirely unrelated.  Please see:

* 
https://docs.sqlalchemy.org/en/14/changelog/migration_20.html#migration-to-2-0-step-four-use-the-future-flag-on-engine
* 
https://docs.sqlalchemy.org/en/14/changelog/migration_20.html#migration-to-2-0-step-four-use-the-future-flag-on-session

> However, I did find self.request.dbsession.bind._is_future.
>

that is `Session.bind`, which will be an `Engine` or `Connection` object - 
not the Session itself.
 

> If I use the code below in __init__.py:main() before settings is passed to 
> Configurator():
>
> settings['sqlalchemy.future'] = True
>

Assuming you are using the cookiecutter setup, this only affects the 
Engine. Please see:

https://github.com/Pylons/pyramid-cookiecutter-starter/blob/latest/%7B%7Bcookiecutter.repo_name%7D%7D/%7B%7Bcookiecutter.repo_name%7D%7D/sqlalchemy_models/__init__.py#L15-L16

So, if this is the correct flag SQLAlchemy sets/uses, it appears to be 
> making the trip all the way into the view, which is what I wanted to 
> validate.
>

Your Engine is in future mode, but your Session is not.  As Theron noted, 
you need to change your sessionmaker construction.  If you are using the 
cookiecutter setup, this is what must be adjusted:

https://github.com/Pylons/pyramid-cookiecutter-starter/blob/latest/%7B%7Bcookiecutter.repo_name%7D%7D/%7B%7Bcookiecutter.repo_name%7D%7D/sqlalchemy_models/__init__.py#L19-L22

 
 

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/74d9b5e4-1006-4d70-b61b-af20d35c00bfn%40googlegroups.com.

Reply via email to