Hi all,
I need to iterate the 'dynamic' attributes (properties) as well as
simple static ones.
this is my table:
tariffa(
codice text,
aliquota_iva text,
aliquota_enpav text,
centro_costo text,
cod_funzione_calcolo text,
unita_misura
)
This is my mapper:
class Tariffa(DomainObject):
def __str__(self):
return str(self.codice) or repr(self)
assign_mapper(context, Tariffa, tbl['tariffa'],
properties = {'frazioni' : relation(Frazione),
'funzionecalcolo': relation(FunzioneCalcolo),
'um' : relation(UnitaDiMisura),
'descrizione' : relation(Verifica,
primaryjoin =
tbl['verifica'].c.codice == tbl['tariffa'].c.codice),
I tried this...
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
In this way I can access only static properies.
What can I do to iterate the others (frazioni,funzionecalcolo, um,
descrizione) ?
Thank you,
jo
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---