[sqlalchemy] Mapping MySQL geometry type.

2009-07-15 Thread J. Cliff Dyer
I'm trying to create a custom geometry type for MySQL, but I'm running up against my limited knowledge of SQLAlchemy. My goal is to be able to pass in a geos.Point object on INSERT and UPDATE, convert it to WKT representation ('POINT (1. 2.)'), and pass that to

[sqlalchemy] Re: Mapper with declarative

2009-04-07 Thread J. Cliff Dyer
On Tue, 2009-04-07 at 06:28 -0700, Scripper wrote: Hello everyone, I have a concrete question about using declarative mapper in my project. When i there appeared some errors. I wonder whether declarative mapper supports two relation in a single class. Thanks! Well, so far, that's an

[sqlalchemy] Re: SQLAlchemy Migrate

2009-03-06 Thread J. Cliff Dyer
On Thu, 2009-03-05 at 01:03 -0800, jarrod.ches...@gmail.com wrote: Hi All I'm writing a metadata based schema migration tool. As SQLAlchemy doesn't support much schema modification. I will implement a complete set of schema migration functions one way or another for several of the

[sqlalchemy] Re: Temporarily disabling autoflush

2008-07-08 Thread J. Cliff Dyer
Not knowing your specific requirements, can you use a separate session? Just instantiate it for the manual-flushing section, and then close it out, and go back to using your old session. Cheers, Cliff On Tue, 2008-07-08 at 05:57 -0700, Moshe C. wrote: Hi, I have an autoflush session and I

[sqlalchemy] UnboundExecutionError with SQL objects in subclassed Django Context

2008-06-12 Thread J. Cliff Dyer
In the following code, I am using django templates to render data from a SQLAlchemy-mapped database. I subclass django.template.Context, so that I can pass it a unique ID, from which it determines what to pull from the DB. But when it comes time to render the template (that is: when I actually

[sqlalchemy] Polymorphic across foreign key

2008-05-15 Thread J. Cliff Dyer
I'm trying to implement polymorphic inheritance using the sqlalchemy.ext.declarative, but the field that I want to use for the polymorphic_on is not in my polymorphic base table, but at the other end of a many-to-one relationship. We have items of many types, and in the item table, we have a

[sqlalchemy] Re: Polymorphic across foreign key

2008-05-15 Thread J. Cliff Dyer
On Thu, 2008-05-15 at 11:24 -0400, J. Cliff Dyer wrote: I'm trying to implement polymorphic inheritance using the sqlalchemy.ext.declarative, but the field that I want to use for the polymorphic_on is not in my polymorphic base table, but at the other end of a many-to-one relationship. We

[sqlalchemy] Re: Polymorphic across foreign key

2008-05-15 Thread J. Cliff Dyer
On Thu, 2008-05-15 at 11:30 -0400, J. Cliff Dyer wrote: On Thu, 2008-05-15 at 11:24 -0400, J. Cliff Dyer wrote: I'm trying to implement polymorphic inheritance using the sqlalchemy.ext.declarative, but the field that I want to use for the polymorphic_on is not in my polymorphic base table

[sqlalchemy] Re: Polymorphic across foreign key

2008-05-15 Thread J. Cliff Dyer
On Thu, 2008-05-15 at 12:27 -0400, Michael Bayer wrote: On May 15, 2008, at 12:12 PM, J. Cliff Dyer wrote: How can I use this field for polymorphism? Is it possible? polymorphic discriminators are currently table-local scalar columns. So if you had a many-to-one

[sqlalchemy] what = declarative_base

2008-04-02 Thread J. Cliff Dyer
It makes me twitch when I see the following: Base = declarative_base(metadata=metadata) class Spam(Base): ... Base is a singularly undescriptive name to use for the base class of a declarative table class. People are doing this because it's in the documentation. If it were changed there,