Re: [sqlalchemy]why I can't use custom type by form_statement method??

2010-04-20 Thread Cancer
o yeah! I solved the question~ these are codes.hope it's useful to someone who have the same question~ crew = query.from_statement(text("SELECT * from crew_member where " + "rtrim(crew_member.lastname) || rtrim(crew_member.firstname) " +

Re: [sqlalchemy] case sensitive Unicode and String columns

2010-04-20 Thread Chris Withers
Michael Bayer wrote: Please let me know if there's a better way! you should use TypeDecorator.load_dialect_impl(dialect), check the "name" of the dialect, Why the name rather than doing: if isinstance(dialect,MySQLDialect): ? then return either MSString(arguments) or super.load_dialect_i

Re: [sqlalchemy]why I can't use custom type by form_statement method??

2010-04-20 Thread Cancer
I'm back again anyone use TG2?? when I use the statement above.it can works well in background. but it doesn't work at controller.. any suggestion is welcome~ 2010/4/20 Cancer > o yeah! > > I solved the question~ > > these are codes.hope it's useful to someone who have the same question~

Re: [sqlalchemy] SQLAlchemy 0.6.0 released

2010-04-20 Thread Diana Clarke
Yes, Congratulations & Thank-you! --diana On Sun, Apr 18, 2010 at 8:02 PM, Michael Bayer wrote: > The first official 0.6 release of SQLAlchemy is now available. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email t

Re: [sqlalchemy] bug in sqllite dialect?

2010-04-20 Thread Chris Withers
Michael Bayer wrote: Chris Withers wrote: Michael Bayer wrote: Has anyone (hi, list, talking to you too!) already done a custom type for this specific problem? people do custom types for all sorts of things. In the case of the Decimal here I'd likely subclass sqlalchemy.databases.sqlite.SLNum

[sqlalchemy] docs for TypeDecorators

2010-04-20 Thread Chris Withers
Hi All, Are there any other docs for using and creating TypeDecorators than these: http://www.sqlalchemy.org/docs/05/reference/sqlalchemy/types.html#custom-types The following sections: http://www.sqlalchemy.org/docs/05/reference/sqlalchemy/types.html#sqlalchemy.types.TypeDecorator.__init__ .

[sqlalchemy] Re: SQLAlchemy 0.6.0 released

2010-04-20 Thread Gerry Reno
Congratulations Mike and contributors. This is an important milestone in the evolution of SQLAlchemy. Thanks for all the hard work. -Gerry > On Sun, Apr 18, 2010 at 8:02 PM, Michael Bayer > wrote: > > The first official 0.6 release of SQLAlchemy is now available. > > -- > You received this

Re: [sqlalchemy] case sensitive Unicode and String columns

2010-04-20 Thread Michael Bayer
Chris Withers wrote: > Michael Bayer wrote: >>> Please let me know if there's a better way! >> >> you should use TypeDecorator.load_dialect_impl(dialect), check the >> "name" of the dialect, > > Why the name rather than doing: > > if isinstance(dialect,MySQLDialect): you could do that too, though

Re: [sqlalchemy] bug in sqllite dialect?

2010-04-20 Thread Michael Bayer
Chris Withers wrote: > Michael Bayer wrote: >> Chris Withers wrote: >>> Michael Bayer wrote: > Has anyone (hi, list, talking to you too!) already done a custom type > for this specific problem? people do custom types for all sorts of things. In the case of the Decimal here I'd li

Re: [sqlalchemy] docs for TypeDecorators

2010-04-20 Thread Michael Bayer
Chris Withers wrote: > Hi All, > > Are there any other docs for using and creating TypeDecorators than these: > > http://www.sqlalchemy.org/docs/05/reference/sqlalchemy/types.html#custom-types > > The following sections: > > http://www.sqlalchemy.org/docs/05/reference/sqlalchemy/types.html#sqlalche

Re: [sqlalchemy] docs for TypeDecorators

2010-04-20 Thread Chris Withers
Michael Bayer wrote: http://www.sqlalchemy.org/docs/05/reference/sqlalchemy/types.html#sqlalchemy.types.TypeDecorator.__init__ ...are a little less detailed than they could be ;-) Let me talk to one of our committers to see if they can help us. Hey Chris - want to beef up the docs for Typ

Re: [sqlalchemy] bug in sqllite dialect?

2010-04-20 Thread Chris Withers
Michael Bayer wrote: the whole ugly discussion is at http://www.sqlalchemy.org/trac/ticket/1759 Speshul... *sigh* I'm glad I don't have your responsibilities ;-) Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.uk -- You r

[sqlalchemy] testing?

2010-04-20 Thread Harry Percival
how do I run some self-testing in sqlalchemy? I found this doc, but it seems to be out of date?? http://svn.sqlalchemy.org/sqlalchemy/trunk/README.unittests just for fun, i'm trying to run these tests inside IronPython, so any pointers in that direction would be helpful also.. thx, HP -- You

Re: [sqlalchemy] testing?

2010-04-20 Thread Michael Bayer
Please read the document: http://svn.sqlalchemy.org/sqlalchemy/trunk/README_MOVED_TO_MERCURIAL Harry Percival wrote: > how do I run some self-testing in sqlalchemy? I found this doc, but > it seems to be out of date?? > > http://svn.sqlalchemy.org/sqlalchemy/trunk/README.unittests > > just f

[sqlalchemy] custom dialect with no "join" syntax support possible?

2010-04-20 Thread Lance Edgar
Hi, I'm writing a new custom dialect for a legacy database (Centura SQLBase 7.5.1) for use in migrating to a new system over time. Everything's gone pretty well, until I needed a join... Whereas most dialects would create a statement such as: SELECT T1.ID, T1.COL1, T2.COL2 FROM T1 JOIN T2 ON T1.I

[sqlalchemy] Custom ORM attributes to provide on-the-fly data conversion

2010-04-20 Thread Rhett
I've run into some difficulty getting the ORM to fit into an existing code base with some, I suppose, non-standard conventions. One of the conventions is to not allow primary keys (auto-incremented integers) to be exposed on the front-end servlet or template but to maintain the original integer va

Re: [sqlalchemy] custom dialect with no "join" syntax support possible?

2010-04-20 Thread Michael Bayer
On Apr 20, 2010, at 4:47 PM, Lance Edgar wrote: > Hi, I'm writing a new custom dialect for a legacy database (Centura > SQLBase 7.5.1) for use in migrating to a new system over time. > Everything's gone pretty well, until I needed a join... > > Whereas most dialects would create a statement such

[sqlalchemy] Creating sequence

2010-04-20 Thread Wichert Akkerman
What is the preferred method to have metadata.create_all() create sequences? I tried to find something in the wiki but could not find anything. For indexes you can do this: schema.Index("public_event_idx", Event.workflow, Event.deleted) but a similar statement for a sequence: schema.Sequence(

Re: [sqlalchemy] Custom ORM attributes to provide on-the-fly data conversion

2010-04-20 Thread Michael Bayer
On Apr 20, 2010, at 7:06 PM, Rhett wrote: > I've run into some difficulty getting the ORM to fit into an existing > code base with some, I suppose, non-standard conventions. > > One of the conventions is to not allow primary keys (auto-incremented > integers) to be exposed on the front-end servl

Re: [sqlalchemy] Creating sequence

2010-04-20 Thread Michael Bayer
Sequence has a create() method but doesn't yet link into metadata.create_all() without being assocaited with a Table. So yes you'd use DDL or in 0.6 the CreateSequence() construct. On Apr 20, 2010, at 7:26 PM, Wichert Akkerman wrote: > What is the preferred method to have metadata.create_all(

Re: [sqlalchemy] Custom ORM attributes to provide on-the-fly data conversion

2010-04-20 Thread Michael Bayer
On Apr 20, 2010, at 7:32 PM, Michael Bayer wrote: > > if you want MyClass.encrypted_id to be available in queries at the class > level, this would require a SQL function that does your "encryption". See > examples/derived_attributes/ for some techniques on that. correction, you'd probably wa

Re: [sqlalchemy] Custom ORM attributes to provide on-the-fly data conversion

2010-04-20 Thread Rhett Garber
On Tue, Apr 20, 2010 at 4:32 PM, Michael Bayer wrote: > > On Apr 20, 2010, at 7:06 PM, Rhett wrote: > >> I've run into some difficulty getting the ORM to fit into an existing >> code base with some, I suppose, non-standard conventions. >> >> One of the conventions is to not allow primary keys (aut