[sqlalchemy] Re: SQLAlchemy ORM Object caching with relationships and invalidation

2012-09-27 Thread David McKeone
Hi Mike, I'll let the others add more detail about your questions, but for the broad strokes I thought I'd add that I ran into similar issues with my simple caching method and ultimately ended up using the new Dogpile.cache stuff that Mike recommended on his

Re: [sqlalchemy] Dogpile.cache w/ SQLAlchemy

2012-09-26 Thread David McKeone
This example has worked really well so far, but I thought I'd mention that I ran into few small things and made some changes. 1) This is was minor. I wanted to be able to use the cache_regions on multiple databases from the same program so I made the CachingQuery class take a parameter with

Re: [sqlalchemy] Dogpile.cache w/ SQLAlchemy

2012-09-26 Thread David McKeone
Fair enough about the example stuff; I kind of figured, but thought I'd just share my experience. It's such a fine-line between authors getting a bead on real-world usage vs. hearing the same question over and over again. Previously, I had it just using the binds that were in the Query, but we

[sqlalchemy] Dogpile.cache w/ SQLAlchemy

2012-09-24 Thread David McKeone
As per this comment: http://techspot.zzzeek.org/2012/04/19/using-beaker-for-caching-why-you-ll-want-to-switch-to-dogpile.cache/#comment-503780670 Has any work been put into an example for using Dogpile.cache with SQLAlchemy? I'm about to embark on implementing caching and I don't want to

Re: [sqlalchemy] Dogpile.cache w/ SQLAlchemy

2012-09-24 Thread David McKeone
Great, thanks Mike! On Monday, September 24, 2012 4:15:29 PM UTC+2, Michael Bayer wrote: yes, the example in 0.8 should be changed to this, but I haven't done it yet. dogpile's usage is similar to Beaker as far as the general calling pattern. A tutorial format of the example using

Re: [sqlalchemy] SELECT * FROM function() with declarative

2012-09-21 Thread David McKeone
by creating a select() out of it, check out the fifth example at http://docs.sqlalchemy.org/en/rel_0_7/core/tutorial.html#functions On Sep 20, 2012, at 1:09 PM, David McKeone wrote: Hi M, Is creating something in the database the only way to do it? How would I coerce the view's return type

[sqlalchemy] SELECT * FROM function() with declarative

2012-09-20 Thread David McKeone
I've googled around can't seem to find an answer to this, so hopefully someone knows how to do it here. I'm using PostgreSQL and I have a PL/PGSQL function that filters and modifies a particular table based on a number of conditions and then returns a set of rows as the result. This pattern

Re: [sqlalchemy] Portable date intervals?

2012-09-04 Thread David McKeone
Great, thanks Mike! I only need to do PostgreSQL, but I will look into the @compiles decorator to make a more general solution. . -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To view this discussion on the web visit

Re: [sqlalchemy] SQLAlchemy with Flask -- hybrid models?

2012-08-23 Thread David McKeone
On Thursday, August 23, 2012 3:01:50 AM UTC+1, Michael Bayer wrote: On Aug 22, 2012, at 5:33 PM, David McKeone wrote: I suppose I should be more clear. This is really a long term question, I was just looking for some kind of answer now because I don't want to code myself

[sqlalchemy] SQLAlchemy with Flask -- hybrid models?

2012-08-22 Thread David McKeone
I've been using SQLAlchemy with Flask via the Flask extension Flask-SQLAlchemy. Everything works great so far, but I foresee a potential problem once I start to use my database model outside of Flask. In the future I'd like to be able to use my models with non-Flask SQLAlchemy (a worker

Re: [sqlalchemy] SQLAlchemy with Flask -- hybrid models?

2012-08-22 Thread David McKeone
On Wednesday, August 22, 2012 2:23:28 PM UTC+1, Simon King wrote: On Wed, Aug 22, 2012 at 12:51 PM, David McKeone davidm...@gmail.comjavascript: wrote: I've been using SQLAlchemy with Flask via the Flask extension Flask-SQLAlchemy. Everything works great so far, but I foresee

Re: [sqlalchemy] SQLAlchemy with Flask -- hybrid models?

2012-08-22 Thread David McKeone
On Wednesday, August 22, 2012 2:33:01 PM UTC+1, David McKeone wrote: On Wednesday, August 22, 2012 2:23:28 PM UTC+1, Simon King wrote: On Wed, Aug 22, 2012 at 12:51 PM, David McKeone davidm...@gmail.com wrote: I've been using SQLAlchemy with Flask via the Flask extension Flask

Re: [sqlalchemy] SQLAlchemy with Flask -- hybrid models?

2012-08-22 Thread David McKeone
On Wednesday, August 22, 2012 3:12:02 PM UTC+1, Simon King wrote: On Wed, Aug 22, 2012 at 2:44 PM, David McKeone davidm...@gmail.comjavascript: wrote: On Wednesday, August 22, 2012 2:33:01 PM UTC+1, David McKeone wrote: On Wednesday, August 22, 2012 2:23:28 PM UTC+1

Re: [sqlalchemy] SQLAlchemy with Flask -- hybrid models?

2012-08-22 Thread David McKeone
On Wednesday, August 22, 2012 3:12:02 PM UTC+1, Simon King wrote: On Wed, Aug 22, 2012 at 2:44 PM, David McKeone davidm...@gmail.comjavascript: wrote: On Wednesday, August 22, 2012 2:33:01 PM UTC+1, David McKeone wrote: On Wednesday, August 22, 2012 2:23:28 PM UTC+1

Re: [sqlalchemy] SQLAlchemy with Flask -- hybrid models?

2012-08-22 Thread David McKeone
On Wednesday, August 22, 2012 5:36:22 PM UTC+1, Michael Bayer wrote: On Aug 22, 2012, at 7:51 AM, David McKeone wrote: I've been using SQLAlchemy with Flask via the Flask extension Flask-SQLAlchemy. Everything works great so far, but I foresee a potential problem once I start to use my

Re: [sqlalchemy] SQLAlchemy with Flask -- hybrid models?

2012-08-22 Thread David McKeone
On Wednesday, August 22, 2012 9:03:55 PM UTC+1, Michael Bayer wrote: On Aug 22, 2012, at 3:51 PM, David McKeone wrote: I was wondering if you could just clarify how I might convert a standard model object into a flask-sqlalchemy model object. why do you need to do this ?What

Re: [sqlalchemy] SQLAlchemy with Flask -- hybrid models?

2012-08-22 Thread David McKeone
On Wednesday, August 22, 2012 10:21:59 PM UTC+1, David McKeone wrote: On Wednesday, August 22, 2012 9:03:55 PM UTC+1, Michael Bayer wrote: On Aug 22, 2012, at 3:51 PM, David McKeone wrote: I was wondering if you could just clarify how I might convert a standard model object

[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 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