what is multisearch? sort of patternmatching?
http://www.sqlalchemy.org/docs/05/ormtutorial.html#datamapping_querying_common

query(A).filter( or_(
    A.c1.startswith(), 
    A.c2.endswith(),
    A.c3.like('%alabal%'),
    ...
  ))
u can generate the arguments of or_(...)
     
On Friday 27 June 2008 16:12:57 [EMAIL PROTECTED] wrote:
> Hi.
>
> I want to do robust algorithm for searching in tables...the
> simplest example is with table with no relations:
>
> stmt = u'SELECT * FROM '
> stmt += str(b.clients.name)
> stmt += ' WHERE '
> for c in b.Client.c:
>   stmt += str(c)+' like \'%value%\' or '
>
> clients = session.query(Client).from_statement(stmt).all()
>
> There is one big problem using the '%' sign, because python is
> using it to replace values in string like:
> 'Welcom %s to my site' % 'john'
>
> Afterwards I want to search in tables with relations, like:
>
> session.query(Client).add_entity(Address)......
>
> Can anyone help me with this problem?
> What is the sqlalchemy way to make "multisearch" ??
>
> Thx in advance
> m_ax
> 


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