On Feb 25, 2008, at 8:56 AM, Artur wrote:

>
> In Pylons webapp, module "model" I have three tables, orm-mapped with
> autoload=True, and join them as the following:
>
>    result_select = select([
>        merk_table.c.nMerkID,
>        merk_table.c.Merknaam,
>        model_table.c.nModelID,
>        model_table.c.Modelnaam,
>        model_table.c.Deuren,
>        model_table.c.nModelNo,
>        model_table.c.Jaar,
>        type_table.c.nTypeIDHist,
>        type_table.c['100'].label('prijs'),
>        type_table.c['724'].label('zitplaatsen'),
>        type_table.c.Typenaam_2],
>        from_obj=[
>            merk_table.join(
>                model_table,
> merk_table.c.nMerkID==model_table.c.nMerkID).join(
>                    type_table,
> type_table.c.nModelID==model_table.c.nModelID)
>        ]
>        ).alias('auto')
>
> Now, the first strange thing:
> after retrieving rows, the field model_table.c.nModelNo (of type
> INT(11), no keys, no indices, in underlying MySQL db) has as value an
> object of type _CompileOnAttr.
>
> And other fields of the same table and type (eg. Jaar) have proper
> values (of type 'long').
>
> The second strange thing:
> when I import the module and run in from command line, the field
> (nModelNo) gets filled properly (long), and _CompileOnAttr objects are
> only assigned, when it is run as Pylons app.
>
> Is this a bug, known issue?
> I'm looking for it, but maybe someone knows the problem...
>

_CompileOnAttr is an internal component of the object relational  
mapper (ORM).  It does not come into play at all when dealing with  
Table objects.  _CompileOnAttr is created per class-mapped attribute  
when you create a mapper(), and they are removed as soon as mappers  
are compiled.

So I would look here to see if you are using the same name as your  
Table to create an ORM mapped class, or if theres some other way that  
ORM mapped classes are being conflated with table columns somewhere.    
I.e. any usage of mapper() which might be conflicting.



--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to