Python论坛  - 讨论区

标题:[python-chinese] [webpy] 请问关于web.select的like查询写法

2007年10月15日 星期一 22:18

大郎 iexper在gmail.com
星期一 十月 15 22:18:37 HKT 2007

entrys = web.select(tbx+'entrys', where='tags like \'%%$tag%%\'',
vars=locals())

ÔÚwebpy×éÉϵõ½µÄ»Ø¸´ÊÇÓÃÁ½¸ö%À´±£»¤%²»±»´¦Àíµô, ÎÒÓÃÉÏÃæµÄд·¨, ·µ»ØÆäSQLÊÇ:

SELECT * FROM venus_entrys WHERE tags like '%'HTTP'%'

¾ßÌåÖ´ÐÐʱ±¨SQLÓï·¨´íÎó, ÎÒÏëÕâÊǿ϶¨µÄ, Ä£ºý²éѯʱÀïÃæÔõôÄÜÔÙº¬ÒýºÅ!
ÄÄλ֪µÀд·¨? ¶àл!

-- 
ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉ­ÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê...
Gtalk: iexper(at)gmail.com
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20071015/cc8c1c86/attachment.html 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年10月15日 星期一 22:32

@@ askfor在gmail.com
星期一 十月 15 22:32:39 HKT 2007

\'

On 10/15/07, ´óÀÉ <iexper在gmail.com> wrote:
>
> entrys = web.select(tbx+'entrys', where='tags like \'%%$tag%%\'',
> vars=locals())
>
> ÔÚwebpy×éÉϵõ½µÄ»Ø¸´ÊÇÓÃÁ½¸ö%À´±£»¤%²»±»´¦Àíµô, ÎÒÓÃÉÏÃæµÄд·¨, ·µ»ØÆäSQLÊÇ:
>
> SELECT * FROM venus_entrys WHERE tags like '%'HTTP'%'
>
> ¾ßÌåÖ´ÐÐʱ±¨SQLÓï·¨´íÎó, ÎÒÏëÕâÊǿ϶¨µÄ, Ä£ºý²éѯʱÀïÃæÔõôÄÜÔÙº¬ÒýºÅ!
> ÄÄλ֪µÀд·¨? ¶àл!
>
> --
> ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉ­ÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê...
> Gtalk: iexper(at)gmail.com
> _______________________________________________
> python-chinese
> Post: send python-chinese在lists.python.cn
> Subscribe: send subscribe to python-chinese-request在lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20071015/535547e6/attachment-0001.htm 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年10月15日 星期一 22:42

大郎 iexper在gmail.com
星期一 十月 15 22:42:09 HKT 2007

askfor ˵Çå³þһЩ?
$tag·µ»ØʱĬÈÏ×Ô´ø''µÄ, Àý, 'webpy'
ÄãµÄÒâ˼ÊÇÈÃÎÒ°ÑÕâÀïµÄ'webpy'µÄµ¥ÒýºÅÈ¥µô°É? ÇëÎÊÕâÀï¸ÃÈçºÎд? ¶àл! ÎÒpy»ù´¡²»Ì«ºÃ :)

On 10/15/07, @@ <askfor在gmail.com> wrote:
>
> \'
>
> On 10/15/07, ´óÀÉ <iexper在gmail.com> wrote:
>
> > entrys = web.select(tbx+'entrys', where='tags like \'%%$tag%%\'',
> > vars=locals())
> >
> > ÔÚwebpy×éÉϵõ½µÄ»Ø¸´ÊÇÓÃÁ½¸ö%À´±£»¤%²»±»´¦Àíµô, ÎÒÓÃÉÏÃæµÄд·¨, ·µ»ØÆäSQLÊÇ:
> >
> > SELECT * FROM venus_entrys WHERE tags like '%'HTTP'%'
> >
> > ¾ßÌåÖ´ÐÐʱ±¨SQLÓï·¨´íÎó, ÎÒÏëÕâÊǿ϶¨µÄ, Ä£ºý²éѯʱÀïÃæÔõôÄÜÔÙº¬ÒýºÅ!
> > ÄÄλ֪µÀд·¨? ¶àл!
> >
> > --
> > ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉ­ÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê...
> > Gtalk: iexper(at)gmail.com
> > _______________________________________________
> > python-chinese
> > Post: send python-chinese在lists.python.cn
> > Subscribe: send subscribe to python-chinese-request在lists.python.cn
> > Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> >
> > Detail Info: http://python.cn/mailman/listinfo/python-chinese
> >
>
>
> _______________________________________________
> python-chinese
> Post: send python-chinese在lists.python.cn
> Subscribe: send subscribe to python-chinese-request在lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>



-- 
ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉ­ÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê...
Gtalk: iexper(at)gmail.com
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20071015/8e1bf54a/attachment.html 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年10月15日 星期一 23:18

@@ askfor在gmail.com
星期一 十月 15 23:18:20 HKT 2007

²»ºÃÒâ˼ webpyÎÒûÓùý
ÎÒµÄÒâ˼ÊÇ
SELECT * FROM venus_entrys WHERE tags like '%'HTTP'%'

Èç¹ûÄãÏëËÑË÷°üº¬" 'HTTP' "µÄ»°Õâ¸ösqlÓ¦¸ÃÊÇ
SELECT * FROM venus_entrys WHERE tags like '%\'HTTP\'%' ²Å²»»á±¨´í¡£

On 10/15/07, ´óÀÉ <iexper在gmail.com> wrote:
>
> askfor ˵Çå³þһЩ?
> $tag·µ»ØʱĬÈÏ×Ô´ø''µÄ, Àý, 'webpy'
> ÄãµÄÒâ˼ÊÇÈÃÎÒ°ÑÕâÀïµÄ'webpy'µÄµ¥ÒýºÅÈ¥µô°É? ÇëÎÊÕâÀï¸ÃÈçºÎд? ¶àл! ÎÒpy»ù´¡²»Ì«ºÃ :)
>
>  On 10/15/07, @@ < askfor在gmail.com> wrote:
>
> > \'
> >
> >  On 10/15/07, ´óÀÉ < iexper在gmail.com> wrote:
> >
> > > entrys = web.select(tbx+'entrys', where='tags like \'%%$tag%%\'',
> > > vars=locals())
> > >
> > > ÔÚwebpy×éÉϵõ½µÄ»Ø¸´ÊÇÓÃÁ½¸ö%À´±£»¤%²»±»´¦Àíµô, ÎÒÓÃÉÏÃæµÄд·¨, ·µ»ØÆäSQLÊÇ:
> > >
> > > SELECT * FROM venus_entrys WHERE tags like '%'HTTP'%'
> > >
> > > ¾ßÌåÖ´ÐÐʱ±¨SQLÓï·¨´íÎó, ÎÒÏëÕâÊǿ϶¨µÄ, Ä£ºý²éѯʱÀïÃæÔõôÄÜÔÙº¬ÒýºÅ!
> > > ÄÄλ֪µÀд·¨? ¶àл!
> > >
> > > --
> > > ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉ­ÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê...
> > > Gtalk: iexper(at)gmail.com
> > > _______________________________________________
> > > python-chinese
> > > Post: send python-chinese在lists.python.cn
> > > Subscribe: send subscribe to python-chinese-request在lists.python.cn
> > > Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> > >
> > > Detail Info: http://python.cn/mailman/listinfo/python-chinese
> > >
> >
> >
> > _______________________________________________
> > python-chinese
> > Post: send python-chinese在lists.python.cn
> > Subscribe: send subscribe to python-chinese-request在lists.python.cn
> > Unsubscribe: send unsubscribe to
> > python-chinese-request在lists.python.cn
> > Detail Info: http://python.cn/mailman/listinfo/python-chinese
> >
>
>
>
> --
> ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉ­ÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê...
> Gtalk: iexper(at)gmail.com
>
> _______________________________________________
> python-chinese
> Post: send python-chinese在lists.python.cn
> Subscribe: send subscribe to python-chinese-request在lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20071015/9ca9ba94/attachment.html 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年10月15日 星期一 23:27

大郎 iexper在gmail.com
星期一 十月 15 23:27:31 HKT 2007

Ŷ, ²»ÊǵÄ, ÎÒÖ»ÊÇÏë²éѯ°üº¬httpµÄ¼Ç¼.ËùÒÔÓÃ'%http%', ÎÒÊÇ˵ĬÈÏ·µ»Øµ½$tagʱÒÑÊÇ×Ô´ø'ºÅ, ËùÒÔÕâÀï²éѯʧЧÁË.

¸ÕµÃµ½Ò»¸ö½â¾ö°ì·¨ÊÇ:
entrys = web.select(tbx+'entrys', where='tags like $tag', vars=dict(tag='%'+
tag +'%'))

:)

On 10/15/07, @@ <askfor在gmail.com> wrote:
>
> ²»ºÃÒâ˼ webpyÎÒûÓùý
> ÎÒµÄÒâ˼ÊÇ
> SELECT * FROM venus_entrys WHERE tags like '%'HTTP'%'
>
> Èç¹ûÄãÏëËÑË÷°üº¬" 'HTTP' "µÄ»°Õâ¸ösqlÓ¦¸ÃÊÇ
> SELECT * FROM venus_entrys WHERE tags like '%\'HTTP\'%' ²Å²»»á±¨´í¡£
>
> On 10/15/07, ´óÀÉ <iexper在gmail.com> wrote:
>
> > askfor ˵Çå³þһЩ?
> > $tag·µ»ØʱĬÈÏ×Ô´ø''µÄ, Àý, 'webpy'
> > ÄãµÄÒâ˼ÊÇÈÃÎÒ°ÑÕâÀïµÄ'webpy'µÄµ¥ÒýºÅÈ¥µô°É? ÇëÎÊÕâÀï¸ÃÈçºÎд? ¶àл! ÎÒpy»ù´¡²»Ì«ºÃ :)
> >
> >  On 10/15/07, @@ < askfor在gmail.com> wrote:
> >
> > > \'
> > >
> > >  On 10/15/07, ´óÀÉ < iexper在gmail.com> wrote:
> > >
> > > > entrys = web.select(tbx+'entrys', where='tags like \'%%$tag%%\'',
> > > > vars=locals())
> > > >
> > > > ÔÚwebpy×éÉϵõ½µÄ»Ø¸´ÊÇÓÃÁ½¸ö%À´±£»¤%²»±»´¦Àíµô, ÎÒÓÃÉÏÃæµÄд·¨, ·µ»ØÆäSQLÊÇ:
> > > >
> > > > SELECT * FROM venus_entrys WHERE tags like '%'HTTP'%'
> > > >
> > > >
> > > > ¾ßÌåÖ´ÐÐʱ±¨SQLÓï·¨´íÎó, ÎÒÏëÕâÊǿ϶¨µÄ, Ä£ºý²éѯʱÀïÃæÔõôÄÜÔÙº¬ÒýºÅ!
> > > > ÄÄλ֪µÀд·¨? ¶àл!
> > > >
> > > > --
> > > > ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉ­ÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê...
> > > > Gtalk: iexper(at)gmail.com
> > > > _______________________________________________
> > > > python-chinese
> > > > Post: send python-chinese在lists.python.cn
> > > > Subscribe: send subscribe to python-chinese-request在lists.python.cn
> > > > Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> > > >
> > > > Detail Info: http://python.cn/mailman/listinfo/python-chinese
> > > >
> > >
> > >
> > > _______________________________________________
> > > python-chinese
> > > Post: send python-chinese在lists.python.cn
> > > Subscribe: send subscribe to python-chinese-request在lists.python.cn
> > > Unsubscribe: send unsubscribe to
> > > python-chinese-request在lists.python.cn
> > > Detail Info: http://python.cn/mailman/listinfo/python-chinese
> > >
> >
> >
> >
> > --
> > ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉ­ÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê...
> > Gtalk: iexper(at)gmail.com
> >
> > _______________________________________________
> > python-chinese
> > Post: send python-chinese在lists.python.cn
> > Subscribe: send subscribe to python-chinese-request在lists.python.cn
> > Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> >
> > Detail Info: http://python.cn/mailman/listinfo/python-chinese
> >
>
>
> _______________________________________________
> python-chinese
> Post: send python-chinese在lists.python.cn
> Subscribe: send subscribe to python-chinese-request在lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>



-- 
ÿ¸öÈ˶¼ÓÐһƬÊôÓÚ×Ô¼ºµÄÉ­ÁÖ, ÃÔʧµÄÈËÃÔʧÁË, Ïà·êµÄ»¹»áÔÙÏà·ê...
Gtalk: iexper(at)gmail.com
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20071015/4859727a/attachment-0001.htm 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

如下红色区域有误,请重新填写。

    你的回复:

    请 登录 后回复。还没有在Zeuux哲思注册吗?现在 注册 !

    Zeuux © 2025

    京ICP备05028076号