[sqlalchemy] Simple [?] question about column prefixes

2013-06-07 Thread Richard Gerd Kuesters
Hi all! I'm refactoring a database schema but I need it to mantain reverse compatibility with older versions of our software - using views. But, to avoid confusion to other developers, new tables have two underscores as a prefix, like: class Base(object): @declared_attr def

Re: [sqlalchemy] Simple [?] question about column prefixes

2013-06-07 Thread Michael Bayer
On Jun 7, 2013, at 9:31 AM, Richard Gerd Kuesters rich...@humantech.com.br wrote: Hi all! I'm refactoring a database schema but I need it to mantain reverse compatibility with older versions of our software - using views. But, to avoid confusion to other developers, new tables have two

Re: [sqlalchemy] Simple [?] question about column prefixes

2013-06-07 Thread Richard Gerd Kuesters
Thank you Mike! That brings me to another question: Let's say I have created a simple table (well, I have): class Language(Base): language_id = Column(Integer, Sequence('language_id_seq', optional=True), primary_key=True) language = Column(String(5), unique=True, default='undef')

Re: [sqlalchemy] Simple [?] question about column prefixes

2013-06-07 Thread Michael Bayer
OK, the prefix is on the mapped attribute name, not the column.So Language(_language = 'foo'). Guess you're looking for the opposite, huh. This gets more weird but this should work, the main difficulty is limiting the columns being altered to just those within a certain class

Re: [sqlalchemy] Simple [?] question about column prefixes

2013-06-07 Thread Richard Gerd Kuesters
Woah, I may have wondered that when I thought on attaching an event, but yes I was thinking the opposite when using it like the underscores in the table name level. I can't see how this was easier - lol - but it makes sense to me :) Thanks Mike! This should get into the SA examples or