On Mon, Apr 21, 2008 at 10:37 AM, Eric Lemoine <[EMAIL PROTECTED]> wrote: > Hello > > I'm trying to use the "key" argument in my mapping: > > refugees_table = Table('refugee', > MetaData(config['pylons.g'].sa_unhcr_webgis_engine), > Column('refugee_fid', types.Integer, primary_key=True), > Column('id', types.Float, key='_id'), > autoload=True, > schema='hqmap') > > But I get this Error Traceback when calling mapper(Refugee, refugees_table): > > Module ?:25 in <module> > >> from unhcr.model.refugees import refugees_table, Refugee > Module ?:47 in <module> > >> mapper(Refugee, refugees_table) > Module sqlalchemy.orm:518 in mapper > :>> return Mapper(class_, local_table, *args, **params) > Module sqlalchemy.orm.mapper:152 in __init__ > >> self._compile_tables() > Module sqlalchemy.orm.mapper:436 in _compile_tables > >> raise exceptions.ArgumentError("Cant resolve column " + str(col)) > <class 'sqlalchemy.exceptions.ArgumentError'>: Cant resolve column refugee.id > > Any idea?
I figured that if I remove autoload=True I don't have the problem. Is this expected? I thought I could use autoload and do some overriding. -- Eric --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---