[sqlalchemy] Re: column renaming and adding

2008-09-25 Thread Wim Verhavert
Thanks Michael! That's a good thing to know! On Thu, Sep 25, 2008 at 3:51 AM, Michael Bayer <[EMAIL PROTECTED]> wrote: > > > On Sep 24, 2008, at 2:34 PM, Wim Verhavert wrote: > >> >> How is this possible? I thought that by saying: >> >> properti

[sqlalchemy] column renaming and adding

2008-09-24 Thread Wim Verhavert
I have a setup like this: class Entity(object): pass class Persoon(Entity): pass entity_tabel = Table('contact', metadata, Column('contactid', Integer, primary_key=True), Column('voornaam', String(75)), Col

[sqlalchemy] Re: default values for columns in select mappers

2008-09-04 Thread Wim Verhavert
ar props. > > otherwise u may need explicit mapping to get the relation.type... > (assoc.object), i leave that to your exercise. > > plz do not expect the above to be THE solution, u may have to fix > mistakes or tweak or even abandon ... read docs on inheritance, > relations (many2ma

[sqlalchemy] Re: default values for columns in select mappers

2008-09-04 Thread Wim Verhavert
all goes in one table, regardless if it is one class of whole tree > of not-realy-related-ones. what is the python side of things is up to > you. why is that "entity" base class bothering you? declare it just > inheriting object without attributes, but dont use it.. > or ma

[sqlalchemy] Re: default values for columns in select mappers

2008-09-04 Thread Wim Verhavert
Thanks for the quick answers. But I'm left with some side-effect I'm a little bit struggling with: in order for this to work myObject and myOtherObject need to inherit some base class let's say 'entity'. Now the ones who created the database clearly didn't had much experience with databases (damn

[sqlalchemy] Re: default values for columns in select mappers

2008-09-03 Thread Wim Verhavert
Thanks! That's indeed the stuff I was looking for! On Wed, Sep 3, 2008 at 9:23 PM, Michael Bayer <[EMAIL PROTECTED]> wrote: > > > On Sep 3, 2008, at 2:59 PM, [EMAIL PROTECTED] wrote: > >> >> I have 1 table (mytable) which is structured somewhat like this: >> id = int (primary key) >> name = varch

[sqlalchemy] default values for columns in select mappers

2008-09-03 Thread wim . verhavert
Hi all, I just started playing with SQLAlchemy today (after several years of plain SQL experience) and I must say I'm impressed. I'm reading my way through the docs now, but there is one thing I can't seem to find. Let me briefly explain the situation. I was given the task of rewriting a databas