Re: [sqlalchemy] UNION in many-to-many relation

2011-09-23 Thread Vlad K.
Hi, thanks for your help! That works. .oO V Oo. On 09/19/2011 11:03 PM, Michael Bayer wrote: On Sep 19, 2011, at 12:45 PM, Vlad K. wrote: Hi! I have a model, let's call it Resource. And another, let's call it Container. Each container can have any number of Resources, so they're in

[sqlalchemy] Please enhance SA support on loading dialect from entry points

2011-09-23 Thread Jaimy Azle
Hi Michael, As on subject, when loading an external dialect from entry points (sqlalchemy.dialects), currently it is not possible to load a database dialect with alternate driver which might be supported using general connection url pattern:

[sqlalchemy] Re: using @declared_attr to define a column in an actual class (non-mixin)

2011-09-23 Thread Yap Sok Ann
Thanks for clearing that up. __abstract__ = True looks like a nice addition. In this case, I decided to go with the metaclass approach, i.e. declaring the attributes as usual, and then delete them if necessary in the metaclass. On Sep 23, 1:36 pm, Michael Bayer mike...@zzzcomputing.com wrote:

Re: [sqlalchemy] Please enhance SA support on loading dialect from entry points

2011-09-23 Thread Michael Bayer
On Sep 23, 2011, at 5:31 AM, Jaimy Azle wrote: Hi Michael, As on subject, when loading an external dialect from entry points (sqlalchemy.dialects), currently it is not possible to load a database dialect with alternate driver which might be supported using general connection url pattern:

[sqlalchemy] attributes.get_history() seems inconsistent when changing from NULL versus to NULL

2011-09-23 Thread Kent
I have two scalar columns in this example. (This is SQLAlchemy-0.6.4) = To NULL == print l.percentofsale1 100 l.percentofsale1=None attributes.get_history(l,'percentofsale1') ([None], (), [Decimal('100')]) = From NULL == print l.discount None

Re: [sqlalchemy] Please enhance SA support on loading dialect from entry points

2011-09-23 Thread Jaimy Azle
On Friday, September 23, 2011, 9:19:57 PM, Michael Bayer wrote: curious, is this for an alternate DBAPI implementation to an existing database, like postgresql+somenewdriver:// ? or multiple, alternate drivers for non-supported databases ? Can I get some specific examples? its not clear how

[sqlalchemy] Re: attributes.get_history() seems inconsistent when changing from NULL versus to NULL

2011-09-23 Thread Kent
I see the code specifically treats going from None as deleted = (): 1417else: 1418 - if original is not None: 1419deleted = [original] 1420else: 1421deleted = () 1422return

Re: [sqlalchemy] Re: attributes.get_history() seems inconsistent when changing from NULL versus to NULL

2011-09-23 Thread Michael Bayer
I can look later today, but what does 0.7 do? Sent from my iPhone On Sep 23, 2011, at 11:17 AM, Kent jkentbo...@gmail.com wrote: I see the code specifically treats going from None as deleted = (): 1417else: 1418 - if original is not None: 1419

[sqlalchemy] Re: attributes.get_history() seems inconsistent when changing from NULL versus to NULL

2011-09-23 Thread Kent
Sorry for not checking in the first place. From the looks of this 0.7 code and specifically from the comment, it seems you've already changed this: @classmethod def from_scalar_attribute(cls, attribute, state, current): original = state.committed_state.get(attribute.key,

[sqlalchemy] Dropping all tables + more

2011-09-23 Thread Russ
Is the DropEverything recipe still the best way to drop everything via SQLAlchemy? http://www.sqlalchemy.org/trac/wiki/UsageRecipes/DropEverything The recipe is ancient (almost a year old! :) ) and I just want to check if there is a better way now. How I got here (for searchability)... When

Re: [sqlalchemy] Please enhance SA support on loading dialect from entry points

2011-09-23 Thread Michael Bayer
On Sep 23, 2011, at 11:08 AM, Jaimy Azle wrote: On Friday, September 23, 2011, 9:19:57 PM, Michael Bayer wrote: curious, is this for an alternate DBAPI implementation to an existing database, like postgresql+somenewdriver:// ? or multiple, alternate drivers for non-supported databases ?

Re: [sqlalchemy] Re: attributes.get_history() seems inconsistent when changing from NULL versus to NULL

2011-09-23 Thread Michael Bayer
yup, so what I can say is that this is one of the many fruits that await you when you get onto 0.7 :).attribute stuff is very difficult to change in a maintenance release as every minute behavior affects all kinds of things. The history of the attribute system is this: the current idea

Re: [sqlalchemy] Dropping all tables + more

2011-09-23 Thread Michael Bayer
On Sep 23, 2011, at 1:35 PM, Russ wrote: Is the DropEverything recipe still the best way to drop everything via SQLAlchemy? http://www.sqlalchemy.org/trac/wiki/UsageRecipes/DropEverything The recipe is ancient (almost a year old! :) ) and I just want to check if there is a better way