the docs for 0.6:

http://www.sqlalchemy.org/docs/

and the session bind thing you can see some info about:

http://www.sqlalchemy.org/docs/orm/session.html#sqlalchemy.orm.session.sessionmaker


On Apr 30, 2011, at 12:40 PM, Mihir Sevak wrote:

> It is a different version of Sqlalchemy.
> Also the project is written in Pylons so we are upgrading that which requries 
> SQLAlchemy 0.6.x.
>  
> Is there some book or reading material you can point me to pleas??
> 
> Thanks.
> 
> On Sat, Apr 30, 2011 at 12:36 PM, Michael Bayer <mike...@zzzcomputing.com> 
> wrote:
> this has to do with how the Session is configured and if its linked to an 
> engine.
> 
> Curious, the "upgrade" happening here is strictly because a newer version of 
> Debian has a different version of SQLAlchemy ?    It would be really, really 
> preferable if you could run the specific version of SQLAlchemy the app was 
> written against, we change the API with each 0.x version.    This does 
> however mean you'd need to install SQLAlchemy using standard Python 
> setuptools methodologies and not via a deb package.    The effort you're 
> making here would be towards porting the app to 0.5.8 based on your trace 
> below...we're already up to 0.7.   With a straight install, it only means 
> SQLAlchemy would be installed under "site-packages" instead of 
> "dist-packages".
> 
> 
> On Apr 29, 2011, at 8:54 PM, Mihir Sevak wrote:
> 
>> Actually to be specific I am getting following error now 
>> 
>> 
>> Errorlog
>> *****************************************************************************************
>> File '/home/mihir/development/web/web/controllers/real.py', line 187 in 
>> search
>>   total_matches = matching_products.count()
>> File 
>> '/usr/local/lib/python2.6/dist-packages/SQLAlchemy-0.5.8-py2.6.egg/sqlalchemy/orm/query.py',
>>  line 1552 in count
>>   should_nest = should_nest[0]
>> File 
>> '/usr/local/lib/python2.6/dist-packages/SQLAlchemy-0.5.8-py2.6.egg/sqlalchemy/orm/query.py',
>>  line 1583 in _col_aggregate
>>   return self.session.scalar(s, params=self._params, 
>> mapper=self._mapper_zero())
>> File 
>> '/usr/local/lib/python2.6/dist-packages/SQLAlchemy-0.5.8-py2.6.egg/sqlalchemy/orm/session.py',
>>  line 758 in scalar
>>   return self.execute(clause, params=params, mapper=mapper, **kw).scalar()
>> File 
>> '/usr/local/lib/python2.6/dist-packages/SQLAlchemy-0.5.8-py2.6.egg/sqlalchemy/orm/session.py',
>>  line 750 in execute
>>   engine = self.get_bind(mapper, clause=clause, **kw)
>> File 
>> '/usr/local/lib/python2.6/dist-packages/SQLAlchemy-0.5.8-py2.6.egg/sqlalchemy/orm/session.py',
>>  line 888 in get_bind
>>   ', '.join(context)))
>> UnboundExecutionError: Could not locate a bind configured on mapper 
>> Mapper|Product|products, SQL expression or this Session
>> 
>> *******************************************************************************************************
>> 
>> On Fri, Apr 29, 2011 at 8:32 PM, Mihir Sevak <mihir.se...@gmail.com> wrote:
>> Hi Mike thanks very much for taking time to respond to my question. 
>> 
>> After taking the alias away it stopped complaining about that perticular
>> line. But the function which was calling this function did not get query
>> results. So tried to print "q" itself and it was the query-line itself 
>> instead
>> of results.
>> 
>> Something like 
>> 
>> "SELECT xXXX DESC" 
>> 
>> Is there some change in the way to read the results from "q" object?
>> Because I have not changed a single letter of the code and what work
>> on other platform doesn't work here. So i am confused.
>> 
>> 
>> Thanks for your help.
>> 
>> 
>> On Fri, Apr 29, 2011 at 8:13 PM, Michael Bayer <mike...@zzzcomputing.com> 
>> wrote:
>> 
>> On Apr 29, 2011, at 1:55 PM, Mihir wrote:
>> 
>> >  @classmethod
>> >    def fulltext_adv(cls, search_string, raw_search=''):
>> >        q = Session.query(cls)
>> >        text_query = func.to_tsquery(search_string).alias('query')
>> >        q = q.filter(cls.tsv.op('@@')(text_query))
>> >        if raw_search:
>> >            q = q.order_by(Product.name.op('ilike')(raw_search +
>> > '%').desc())
>> >        q = q.order_by(sa.desc(func.ts_rank_cd(cls.tsv,
>> > sa.literal_column('query'), 1)))
>> >        return q
>> >
>> > AttributeError: Element to_tsquery(:to_tsquery_1) does not support
>> > 'as_scalar()'
>> 
>> you probably don't want to call "alias('query')" on the func.to_tsquery() 
>> object.   that turns it into an aliased SELECT construct that isn't 
>> particularly appropriate to pass to an operator ('@@' above).
>> 
>> --
>> 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 
>> sqlalchemy+unsubscr...@googlegroups.com.
>> For more options, visit this group at 
>> http://groups.google.com/group/sqlalchemy?hl=en.
>> 
>> 
>> 
>> 
>> -- 
>> "How can anything be impossible when impossible itself says I M Possible???"
>> Mihir
>> 
>> 
>> 
>> -- 
>> "How can anything be impossible when impossible itself says I M Possible???"
>> Mihir
>> 
>> -- 
>> 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 
>> sqlalchemy+unsubscr...@googlegroups.com.
>> For more options, visit this group at 
>> http://groups.google.com/group/sqlalchemy?hl=en.
> 
> 
> -- 
> 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 
> sqlalchemy+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/sqlalchemy?hl=en.
> 
> 
> 
> -- 
> "How can anything be impossible when impossible itself says I M Possible???"
> Mihir
> 
> -- 
> 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 
> sqlalchemy+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/sqlalchemy?hl=en.

-- 
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 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to