On Jun 25, 2008, at 2:14 PM, bukzor wrote:
> > Thanks. > > Trying to do this in 0.5, it seems someone deleted the Query.compile() > method without updating the rest of the code: > Traceback (most recent call last): > File "./test1.py", line 139, in ? > try: exit(main(*argv)) > File "./test1.py", line 121, in main > print_query(q) > File "./test1.py", line 20, in print_query > print str(q) > File "/python-2.4.1/lib/python2.4/site-packages/ > SQLAlchemy-0.5.0beta1-py2.4.egg/sqlalchemy/orm/query.py", line 1448, > in __str__ > return str(self.compile()) > AttributeError: 'Query' object has no attribute 'compile' its been fixed in trunk. Keep an eye on http://www.sqlalchemy.org/trac/browser/sqlalchemy/trunk/CHANGES . beta2 is out very soon (like, this week). > Reverting to 0.4, there are other problems. Statement.params is a > function, so I added some ()'s, but it just returns the same query > again. Statement.positiontup doesn't exist, and the string stmt > doesn't have formatting to make use of python's % operator. my code example used the 0.5 APIs, but in all cases you have to get the "compiled" object first. This is described in the tutorials for both 0.4 and 0.5, such as at http://www.sqlalchemy.org/docs/05/sqlexpression.html#sql_insert . --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---