> In [1]: oo=Tariffa().select(limit=1)[0]
> In [2]: for jjj in oo.c: print jjj.name
> codice
> aliquota_iva
> aliquota_enpav
> centro_costo
> cod_funzione_calcolo
> unita_misura

oo.c will iterate over the attributes of the mapped table. You can iterate 
over all attributes, including relations defined in mappers, with:

        for one_attr in oo.mapper.props.keys():
                print getattr(oo,one_attr)

Not sure however if that's the correct way...


For "mapper only" properties, you canget them with:
        mapper_props =  oo.mapper.properties.keys()

Actually, oo.mapper.props.keys() is the (almost) concatenation of table + 
mapper properties since:
        set(sorted(cl.c.keys() + cl.mapper.properties.keys())) == 
set(sorted(cl.mapper.props.keys()))
        => True


Hope it helps.

Cheers,

Seb
-- 
Sébastien LELONG
sebastien.lelong[at]sirloon.net

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

Reply via email to