On 11/29/06, Lee McFadden <[EMAIL PROTECTED]> wrote:
> > And how I create arbitrary queries like that:
> >
> > select post_title, post_body from post where match (post_title,
> > post_body) against ('nasty midgets');
> >
> > on SA?
> >
>
> match_query = post_table.select("MATCH (post_title, post_body) AGAINST (:q)")

:q ?

> results = match_query.execute(q="nasty midgets")
>
> # Coerce the results into your post object:
> object_list = session.query(Post).instances(results)
>
>
> Personally I add the query to the object that you want to search then
> add a search method that does the last two lines of code.  That way
> you can just call:
> Post.search("nasty midgets")

Got it. Thanks.

-- 
José de Paula Eufrásio Júnior
aka coredump
http://core.eti.br

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