[sqlalchemy] Declarative and deferred

2012-08-11 Thread David McKeone
Short: --- Is there a way to backfill multiple deferred columns in a declarative object result instance in a dynamic way when groups can't be predicted in the model? Long: First, let me just say thanks for SQLAlchemy. This is my first post to this list and after working with it

Re: [sqlalchemy] Declarative and deferred

2012-08-11 Thread Michael Bayer
On Aug 11, 2012, at 10:08 AM, David McKeone wrote: so with this helper I can context sensitively build up a result object with just the stuff I need (but without losing the benefits of the associated methods): deferred = User.get_deferred_except('id', 'password') # Get list of defer()

Re: [sqlalchemy] Declarative and deferred

2012-08-11 Thread David McKeone
session.refresh(user, [title, first_name, last_name]) This was the part that I was missing. It's fairly readable and it does exactly what I'd need. also, if the columns you're actually using are along these lines, that is, they aren't 10K text files, I'd strongly encourage you to

Re: [sqlalchemy] Declarative and deferred

2012-08-11 Thread Michael Bayer
On Aug 11, 2012, at 3:43 PM, David McKeone wrote: Plus I imagine that session.refresh() would load the entire group if an attribute from a group was passed to it. So that could be an interesting way to chunk it. I think the attributes to session.refresh() trump any deferred rules. It