2008/8/26 Cecil Westerhof <[EMAIL PROTECTED]>:
> First I had:
>        for row in engine.execute('SELECT MIN(gewicht) AS gewicht '
>                                  ',      MIN(vet) AS vet '
>                                  ',      MAX(water) AS water '
>                                  ',      MAX(spieren) AS spieren '
>                                  'FROM   gewicht '):
> but because I want it to have the code engine independend I changed that to:
>        for row in sa.select([sa.func.min(Gewicht.gewicht)
>                               , sa.func.min(Gewicht.vet)
>                               , sa.func.max(Gewicht.water)
>                               , sa.func.max(Gewicht.spieren)]).execute():
> The problem with this is that I now need to use row[0] instead of
> row.gewicht. Is there a way to use row.gewicht also in the case
> sa.select?

I found a solution. In my class Gewicht I added:
  def getEngine(self):
    return gewichtTable.metadata.bind.engine

Before
        for row in engine.execute('SELECT MIN(gewicht) AS gewicht '
I added
    engine = Gewicht().getEngine()
and now I have the old functionality back.

-- 
Cecil Westerhof

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