On Jun 19, 2008, at 11:48 AM, zipito wrote:
> I want something like that
>
> object = some_sql_alchemy_container.some_method(table_name,
> schema_name)
> object.somemethod(with_param)
>
>
> Is this possible ?? If yes - how to achieve this result ?
make a mapper() decorator that does the accounting you want.
from sqlalchemy.orm import mapper as _mapper
my_table_registry = {}
def mapper(cls, table, *args, **kwargs):
my_table_registry[(table.name, table.schema)] = cls
return _mapper(cls, table, *args, **kwargs)
def my_method(table_name, schema_name):
return my_table_registry[(table_name, schema_name)]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---