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 __tablename__(cls):
        return "__%s" % to_python_case(cls.__name__)


Now I want to add column prefixes too. I know I can append to this Base object:

    __mapper_args__ = dict(
        column_prefix='_'
    )

But, when I inherit this new base on classes that I need to use __mapper_args__, column names probably won't have prefixes. Any ideas, perhaps an event listener to prepend the underscore into *all* column names?


Cheers,
Richard.

--
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to