Re: [sqlalchemy] Using a arbitrary select mapper/class in a relation - is this allowed?

2010-02-04 Thread werner
On 03/02/2010 20:25, Michael Bayer wrote: werner wrote: In my model I have: class Country(BaseExt): pass sao.mapper(Country, createSelect(Country_D, Country_T, 'countries_d_id', ['name', 'url'])) Which I can use like this: for cs in session.query(db.Country).all(): print

RE: [sqlalchemy] Using a arbitrary select mapper/class in a relation - is this allowed?

2010-02-04 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of werner Sent: 04 February 2010 09:41 To: sqlalchemy@googlegroups.com Subject: Re: [sqlalchemy] Using a arbitrary select mapper/class in a relation - is this allowed? On

RE: [sqlalchemy] Another tutorial!

2010-02-04 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Mike Driscoll Sent: 04 February 2010 03:34 To: sqlalchemy Subject: [sqlalchemy] Another tutorial! Hi, I just finished up a tutorial series on SqlAlchemy that I thought I'd

Re: [sqlalchemy] Using a arbitrary select mapper/class in a relation - is this allowed?

2010-02-04 Thread werner
On 04/02/2010 11:07, King Simon-NFHD78 wrote: ... Just to confirm, were you actually defining your Region_D class exactly like this: class Region_D(Base, CreateUpdateMixin): __tablename__ = u'regions_d' id = sa.Column(sa.Integer(), sa.Sequence('regions_d_id'),

Re: [sqlalchemy] 0.6b1 and pymssql

2010-02-04 Thread Michael Bayer
On Feb 4, 2010, at 1:13 AM, Domingo Aguilera wrote: I am trying to use 0.6b1 with pymssql ( latest version 1.0.2 ). For it I use create_engine with an uri like mssql+pymssql:// It seems 0.6b1 looks for a dbapi attribute that is not present in pymssql. Is there a workaround for this?

[sqlalchemy] Re: 0.6b1 and pymssql

2010-02-04 Thread Domingo Aguilera
What is the version of pymssql that worked with 0.6 ? On Feb 4, 7:12 am, Michael Bayer mike...@zzzcomputing.com wrote: On Feb 4, 2010, at 1:13 AM, Domingo Aguilera wrote: I am trying to use 0.6b1 with pymssql ( latest version 1.0.2 ).  For it I use create_engine with an uri like

[sqlalchemy] Re: Another tutorial!

2010-02-04 Thread Mike Driscoll
On Feb 4, 4:24 am, King Simon-NFHD78 simon.k...@motorola.com wrote: -Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Mike Driscoll Sent: 04 February 2010 03:34 To: sqlalchemy Subject: [sqlalchemy] Another tutorial! Hi,

[sqlalchemy] order_by() and count()

2010-02-04 Thread gsandorx
hi, i have a typical one to many relationship between two tables: Table_A: contains, for example, Stores (id, store_name) Table_B: contains products, Prod, and which store the products belong to: (id, name, store_id) I need to create a query where i get all Store objects ordered by the number

Re: [sqlalchemy] Re: 0.6b1 and pymssql

2010-02-04 Thread Michael Bayer
Domingo Aguilera wrote: What is the version of pymssql that worked with 0.6 ? judging by what I see here, http://pymssql.sourceforge.net/ and http://sourceforge.net/projects/pymssql/files/, its anything from the pre-1.0 rewrite. But that's also from the 0.3/0.4 days. note the most recent

Re: [sqlalchemy] innerjoin parameter missing in orm.properties.RelationProperty

2010-02-04 Thread Michael Bayer
Julien Cigar wrote: Hello, I'm using SQLAlchemy 0.5.8 with the following mapper definition : http://www.pastie.org/809364 According to the documentation (http://www.sqlalchemy.org/docs/reference/orm/mapping.html#sqlalchemy.orm.relation) I can use an innerjoin parameter on a relation() (to

RE: [sqlalchemy] Re: Another tutorial!

2010-02-04 Thread King Simon-NFHD78
Mike Driscoll wrote: On Feb 4, 8:30 am, Mike Driscoll kyoso...@gmail.com wrote: On Feb 4, 4:24 am, King Simon-NFHD78 simon.k...@motorola.com wrote: [SNIP] Not a serious blunder, but I think there may be a small mistake in part 2, where you describe updating an email address:

[sqlalchemy] Re: Another tutorial!

2010-02-04 Thread Mike Driscoll
On Feb 4, 9:26 am, King Simon-NFHD78 simon.k...@motorola.com wrote: Mike Driscoll wrote: On Feb 4, 8:30 am, Mike Driscoll kyoso...@gmail.com wrote: On Feb 4, 4:24 am, King Simon-NFHD78 simon.k...@motorola.com wrote: [SNIP] Not a serious blunder, but I think there may be a

RE: [sqlalchemy] Re: Another tutorial!

2010-02-04 Thread King Simon-NFHD78
Mike Driscoll wrote: Thanks Simon! That made sense. I've fixed my example to match what you said. Sorry about that. - Mike No problem. I'm afraid you still have a typo though. You have: addresses[0].email_address = Address(pr...@marvel.com) Whereas you want:

RE: [sqlalchemy] Another tutorial!

2010-02-04 Thread John Trammell
You made some serious blunders. Check your comments on the blog post. -Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Mike Driscoll Sent: Wednesday, February 03, 2010 9:34 PM To: sqlalchemy Subject: [sqlalchemy] Another

[sqlalchemy] Re: Another tutorial!

2010-02-04 Thread Mike Driscoll
Simon, On Feb 4, 10:15 am, King Simon-NFHD78 simon.k...@motorola.com wrote: Mike Driscoll wrote: Thanks Simon! That made sense. I've fixed my example to match what you said. Sorry about that. - Mike No problem. I'm afraid you still have a typo though. You have:  

[sqlalchemy] Re: Another tutorial!

2010-02-04 Thread Mike Driscoll
On Feb 4, 10:36 am, John Trammell jo...@holmescorp.com wrote: You made some serious blunders.  Check your comments on the blog post. It looks like Werner found the same issue that Simon already told me about. This has been fixed per Simon's notes. I also found that I forgot to import

[sqlalchemy] 0.6b1 - meta.create_all with FB

2010-02-04 Thread werner
I am doing a bit of testing and run into this exception. Traceback (most recent call last): File saCreateDb.py, line 31, in module meta.create_all(engine) File c:\python25\lib\site-packages\sqlalchemy-0.6beta1-py2.5.egg\sqlalchemy\schema.py, line 1934, in create_all

Re: [sqlalchemy] 0.6b1 - meta.create_all with FB

2010-02-04 Thread Michael Bayer
werner wrote: I am doing a bit of testing and run into this exception. line 614, in do_execute cursor.execute(statement, parameters or []) sqlalchemy.exc.ProgrammingError: (ProgrammingError) (-104, 'isc_dsql_prepare: \n Dynamic SQL Error\n SQL error code = -104\n Token unknown - line

Re: [sqlalchemy] 0.6b1 - meta.create_all with FB

2010-02-04 Thread werner
Michael, Following is just a suggestion. ... that sounds very strange. 0.4 and earlier would use TEXT for String with no size. In 0.5 we did away with that, as its a surprise - we had lot of string with no length complaints, but I would prefer people learn about String/String(50) instead of

Re: [sqlalchemy] 0.6b1 - meta.create_all with FB

2010-02-04 Thread Michael Bayer
werner wrote: Michael, Following is just a suggestion. ... that sounds very strange. 0.4 and earlier would use TEXT for String with no size. In 0.5 we did away with that, as its a surprise - we had lot of string with no length complaints, but I would prefer people learn about

Re: [sqlalchemy] 0.6b1 and pymssql

2010-02-04 Thread Yannick Gingras
On February 4, 2010, Michael Bayer wrote: In 0.6 we can probably just shoot for supporting the new pymssql since its supposed to be much better than the old. I've seen pymssql 1.0.2 segfault the interpreter when under medium load. And yes, I had a core to prove that pymssql was as fault. I

Re: [sqlalchemy] 0.6b1 - meta.create_all with FB

2010-02-04 Thread Michael Bayer
On Feb 4, 2010, at 3:39 PM, werner wrote: OK i see the point about the constructor, though I want to get across that yes the constructor is optional with declarative, but you can still make one. Could the constructor be done in a similar way as you suggested to do the __repr__? it

Re: [sqlalchemy] 0.6b1 and pymssql

2010-02-04 Thread Michael Bayer
On Feb 4, 2010, at 5:49 PM, Yannick Gingras wrote: On February 4, 2010, Michael Bayer wrote: In 0.6 we can probably just shoot for supporting the new pymssql since its supposed to be much better than the old. I've seen pymssql 1.0.2 segfault the interpreter when under medium load. And

[sqlalchemy] mapper class with multiple tables

2010-02-04 Thread atomekk
Hi I'm having trouble with define mapper for class which will include data from more than 2 tables (I'm using Formalchemy for form generation). Quick brieffing on my model: # account table acc_account_table = sa.Table('acc_account', meta.metadata, sa.Column('account_id', sa.types.Integer,

Re: [sqlalchemy] 0.6b1 and pymssql

2010-02-04 Thread Yannick Gingras
On February 4, 2010, Michael Bayer wrote: I've seen pymssql 1.0.2 segfault the interpreter when under medium load. And yes, I had a core to prove that pymssql was as fault. I would probably consider pyodbc is I was stuck with MSSQL. did you contact the pymssql maintainer about that ?