Shaimardanov Rushan at about 10/26/07 5:31 AM said: > How should I execute SA queries in Pylons controllers? (without using > mapping)
you need Session from model > The using of sqlalchemy.sql.select (as whown in SA tutorial gives an error > "<class 'sqlalchemy.exceptions.InvalidRequestError'>: > This Compiled object is not bound to any Engine or Connection." > > My code is: > > from tcounter.model import stats_table #my table > from sqlalchemy.sql import select > > #in controller's method: > s = select([stats_table]) You should have Session in your model.py check current pylons cookbook stuff from tcounter.model import Session res = Session.execute(s) > res = s.execute() > > data = res.fetchall() > > > RUsh > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pylons-discuss" 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/pylons-discuss?hl=en -~----------~----~----~----~------~----~------~--~---
