Re: [Sqlalchemy-users] one-to-one without an extra layer

2006-09-09 Thread Nicola Larosa
> Aaron Spike wrote: >> Anything I should watch out for? Michael Bayer wrote: > falling pianos are a good thing to look out for. Definitely: http://www.fitz-claridge.com/Trebuchet/piano.html -- Nicola Larosa - http://www.tekNico.net/ Special cases aren't special enough to break the rules - b

Re: [Sqlalchemy-users] MSSQL - what am I doing wrong?

2006-09-09 Thread Kent Johnson
Michael Bayer wrote: > its really weird. i am able to get basic create/reflection stuff working > with the pymssql layer, maybe you want to play with that DBAPI for awhile > instead to get things working, then we can try seeing why adodbapi is > failing so much. from your echoing, it is calling "

Re: [Sqlalchemy-users] one-to-one without an extra layer

2006-09-09 Thread Aaron Spike
Michael Bayer wrote: >> I read through the advanced mapper stuff in the docs a few more times >> and I think I've got a start in the right direction. Just want to make >> sure I'm not missing something or misunderstanding the concequences. >> >> persons_join = join(persons_table, photos_table, >>

Re: [Sqlalchemy-users] MSSQL - what am I doing wrong?

2006-09-09 Thread Michael Bayer
its really weird. i am able to get basic create/reflection stuff working with the pymssql layer, maybe you want to play with that DBAPI for awhile instead to get things working, then we can try seeing why adodbapi is failing so much. from your echoing, it is calling "commit", not sure what else

Re: [Sqlalchemy-users] one-to-one without an extra layer

2006-09-09 Thread Michael Bayer
Aaron Spike wrote: >> And now to access a person's photo I have to do "person.photo.photo". Is >> there anyway I can do "person.photo" instead and still have it lazy load >> the photo? I could make a getPhoto() method on the class but is a >> property possible? from my recent work with Hibernate i

Re: [Sqlalchemy-users] Multiple tables with same structure

2006-09-09 Thread Michael Bayer
id go old school and just use a callable: def log_table(name, metadata): return Table(name, metadata, Column('log_id', Integer, primary_key=True), Column(...) ) the Table object is unique per name, so if you call Table twice for the same name/metadata combination, you get the sam

Re: [Sqlalchemy-users] Bug?: Composite primary keys that contain composite foreign keys

2006-09-09 Thread Michael Bayer
Gary Bernhardt wrote: > On 9/8/06, Michael Bayer <[EMAIL PROTECTED]> wrote: > > It might be nice if SA complained about modified PKs. It sure would've > saved me a lot of time. :) Of course, it may be undesirable or > impractical > for reasons I'm not aware of. this actually should be pretty eas

[Sqlalchemy-users] MSSQL - what am I doing wrong?

2006-09-09 Thread Kent Johnson
I decided to start from the beginning and work through the tutorial using MSSQL as the database and adodbapi as the DB-API layer. I didn't get very far... I tried this program: from sqlalchemy import * db = create_engine('mssql://xx:[EMAIL PROTECTED]/SQLAlchemyTest') metadata = BoundMetaData(

Re: [Sqlalchemy-users] one-to-one without an extra layer

2006-09-09 Thread Aaron Spike
Aaron Spike wrote: > I've got a one-to-one relationship something like this. > > class Person(object): > pass > class Photo(object): > pass > > persons_table = Table('persons', metadata, > Column('id', Integer, primary_key=True), > Column('firstname', String(255), > Column('la

[Sqlalchemy-users] one-to-one without an extra layer

2006-09-09 Thread Aaron Spike
I've got a one-to-one relationship something like this. class Person(object): pass class Photo(object): pass persons_table = Table('persons', metadata, Column('id', Integer, primary_key=True), Column('firstname', String(255), Column('lastname', String(255), ... ) photo

[Sqlalchemy-users] Multiple tables with same structure

2006-09-09 Thread Achim Domma
Hi, I have a database with multiple logging tables, which have all the same structure. I want to write a pylons app to display logging records from different tables. The table to be displayed should be selectable from a drop down box. How do I solve this using SQLAlchemy? I assume that I need

Re: [Sqlalchemy-users] Problems with MS SQL Server

2006-09-09 Thread Kent Johnson
Michael Bayer wrote: > i wonder if its something related to the ado module ? it might be > interesting if you could see if thats the case for your particular test > program (or if you could post a full test program to a new trac ticket). > > we're generally in need of a little more help with tes