Re: [sqlalchemy] Using Hybrids for encryption with varying keys

2015-12-14 Thread ThereMichael
Great. It's clear how I'd refer to additional columns with composites, but how would I pass / indicate additional columns with hybrids? Thanks! > OK that's a Python function, plus some key in the table itself? > > You could take the hybrid example and just refer to both columns in the >

Re: [sqlalchemy] Using Hybrids for encryption with varying keys

2015-12-14 Thread ThereMichael
I would say "from a Python function" which could receive some context. Here's why: The keys are stored in an external keystore, which is keyed off of a value in the row. Notionally, the table would look like this: create table secure (external_keystore_key varchar(255), secure_value

[sqlalchemy] Query-invoked autoflush error obfuscated by state_dict KeyError

2015-12-14 Thread Drachenfels
I have following method in my framework: @models.managed_commit def create_article(self, user_uid, title, **kwargs): user = user_manager.UserManager().get_user_by_uid(user_uid) # create empty article article = models.Article(user=user, title=title) # if

Re: [sqlalchemy] table_per_relation ORM example and declarative objects

2015-12-14 Thread Mike Bayer
On 12/14/2015 03:08 AM, Michal Petrucha wrote: > On Thu, Dec 10, 2015 at 12:31:33PM -0500, Mike Bayer wrote: >> >> >> On 12/10/2015 10:21 AM, Michal Petrucha wrote: >>> Hello alchemists, >>> >>> There's something that's been bugging me for a while now. I >>> even asked about it on

Re: [sqlalchemy] Using Hybrids for encryption with varying keys

2015-12-14 Thread Mike Bayer
On 12/14/2015 07:35 AM, ThereMichael wrote: > I would say "from a Python function" which could receive some context. > > Here's why: The keys are stored in an external keystore, which is keyed > off of a value in the row. Notionally, the table would look > like this: > > create table secure

Re: [sqlalchemy] Query-invoked autoflush error obfuscated by state_dict KeyError

2015-12-14 Thread Mike Bayer
On 12/14/2015 10:47 AM, Drachenfels wrote: > I have following method in my framework: > > @models.managed_commit > def create_article(self, user_uid, title, **kwargs): > user = user_manager.UserManager().get_user_by_uid(user_uid) > > # create empty article >

[sqlalchemy] Re: condition on every query

2015-12-14 Thread Victor Uriarte
Just tried running the code you posted, but in my case it keeps using the default query_class (Query) instead of the "MyPrefulteredQuery". Not sure if there was a breaking change on SA since you posted this. On Tuesday, July 22, 2014 at 11:35:49 AM UTC-7, Meg Mitchell wrote: > > I had the same

Re: [sqlalchemy] How to commit objects with circular FK references?

2015-12-14 Thread Gerald Thibault
Thanks for the suggestions and examples. On Sunday, December 13, 2015 at 9:04:17 AM UTC-8, Michael Bayer wrote: > > > > On 12/12/2015 09:56 PM, Gerald Thibault wrote: > > I am loading data from json files, and then creating instances via > > ObjClass(**data), loading them into a session, and

Re: [sqlalchemy] table_per_relation ORM example and declarative objects

2015-12-14 Thread Michal Petrucha
On Thu, Dec 10, 2015 at 12:31:33PM -0500, Mike Bayer wrote: > > > On 12/10/2015 10:21 AM, Michal Petrucha wrote: > > Hello alchemists, > > > > There's something that's been bugging me for a while now. I even > > asked about it on [stackoverflow][1], but it didn't get much > > attention there.

Re: [sqlalchemy] How do a I create Postgres Materialized View using SQLAlchemy?

2015-12-14 Thread Jeff Widman
> > > the descriptions on that page for several other methods say 'see > > execute_at() for more information' so it doesn't exactly "feel" > deprecated. > > I see it just at DDLElement.execute() where that doc should be updated. > Where else? > I think here as well?

Re: [sqlalchemy] How do a I create Postgres Materialized View using SQLAlchemy?

2015-12-14 Thread Mike Bayer
On 12/14/2015 05:33 PM, Jeff Widman wrote: > > the descriptions on that page for several other methods say 'see > > execute_at() for more information' so it doesn't exactly "feel" > deprecated. > > I see it just at DDLElement.execute() where that doc should be updated. > Where