Python论坛  - 讨论区

标题:[python-chinese] turbogears怎么处理动态的表单

2007年04月27日 星期五 16:47

ro rosettas在gmail.com
星期五 四月 27 16:47:31 HKT 2007

hi all

刚用TG一周,碰到个问题
想做一个东西,页面表单的name是动态的,而且表单数量也是动态的


...

此时提交上去的页面tg要如何处理呢
-- 
with kind regards

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

2007年04月27日 星期五 17:03

武长斌 chbin.w在gmail.com
星期五 四月 27 17:03:13 HKT 2007

传来的是一个字典,你用 for把key都循环取出,试试看,半年没用了,你试试吧。

在07-4-27,ro <rosettas at gmail.com> 写道:
>
> hi all
>
> 刚用TG一周,碰到个问题
> 想做一个东西,页面表单的name是动态的,而且表单数量也是动态的
> 
> 
> ...
>
> 此时提交上去的页面tg要如何处理呢
> --
> with kind regards
> _______________________________________________
> python-chinese
> Post: send python-chinese at lists.python.cn
> Subscribe: send subscribe to python-chinese-request at lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese




-- 
武长斌
chbin.w at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://python.cn/pipermail/python-chinese/attachments/20070427/741f83b0/attachment.htm 

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

2007年04月27日 星期五 17:08

ro rosettas在gmail.com
星期五 四月 27 17:08:19 HKT 2007

On 4/27/07, 武长斌 <chbin.w在gmail.com> wrote:
> 传来的是一个字典,你用 for把key都循环取出,试试看,半年没用了,你试试吧。

我明白,我疑惑的是这样传过来的东西应该至少包含name和value的值.怎么把这两个东西从key的元素中取出呢

我试试

-- 
with kind regards

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

2007年04月27日 星期五 17:20

ro rosettas在gmail.com
星期五 四月 27 17:20:37 HKT 2007

我搞定了,谢谢你

    def new(self, **kw):
        for name, value in kw.items():
            print ' %s is %s' % (name, value)


-- 
with kind regards

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

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

    你的回复:

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

    Zeuux © 2025

    京ICP备05028076号