2007年03月22日 星期四 13:56
在limodou撰写的教程中,有一个"通讯录"例子,在addresses_list.html模版中,有两个地方不理解:
第一个: {{ searchvalue}} ,用2个大括号括起来是什么含义,这个用法还挺多的. 
           我理解searchvalue是一个变量,但如何用,何时用不明白?
第二个: 同样在这个模版中,addresses_list.html开头的
{% extends "base" %}
{% block content %}
{% load change_gender %}
是什么含义? 如果自己写程序,如何想到还要加这些?
谢谢!!!
Django Step by Step
« 第六章 Wiki例子 | table of contents | 第八章 通讯录的导入和导出 »
第七章 通讯录
cuix
2007-03-22
-------------- 下一部分 --------------
一个HTML附件被移除...
URL: http://python.cn/pipermail/python-chinese/attachments/20070322/857370b0/attachment.htm 
2007年03月22日 星期四 14:26
On 3/22/07, cuix <cuix在cert.org.cn> wrote: > > > 在limodou撰写的教程中,有一个"通讯录"例子,在addresses_list.html模版中,有两个地方不理解: 这些不应该是疑问, "step by step " 开宗明义,是个人的开发体验, 不是真正的 Django 使用手册, 你的两个问题全部是 Django 用户手册中有的,不应该到列表中询问的哪 http://svn.zoomquiet.org/djdocument/templates/ > > 第一个: {{ searchvalue}} ,用2个大括号括起来是什么含义,这个用法还挺多的. > 我理解searchvalue是一个变量,但如何用,何时用不明白? > >> > 第二个: 同样在这个模版中,addresses_list.html开头的 > {% extends "base" %} > {% block content %} > {% load change_gender %} > 是什么含义? 如果自己写程序,如何想到还要加这些? > > 谢谢!!! > > > Django Step by Step > « 第六章 Wiki例子 | table of contents | 第八章 通讯录的导入和导出 » > > 第七章 通讯录 > > ________________________________ > > cuix > 2007-03-22 > _______________________________________________ > 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 > -- '''Time is unimportant, only life important! http://zoomquiet.org blog在http://blog.zoomquiet.org/pyblosxom/ wiki在http://wiki.woodpecker.org.cn/moin/ZoomQuiet scrap在http://floss.zoomquiet.org douban在http://www.douban.com/people/zoomq/ ____________________________________ Pls. use OpenOffice.org to replace M$ Office. http://zh.openoffice.org Pls. use 7-zip to replace WinRAR/WinZip. http://7-zip.org/zh-cn/ You can get the truely Freedom 4 software. '''
2007年03月23日 星期五 08:47
On 3/22/07, cuix <cuix at cert.org.cn> wrote: > > > 在limodou撰写的教程中,有一个"通讯录"例子,在addresses_list.html模版中,有两个地方不理解: > > 第一个: {{ searchvalue}} ,用2个大括号括起来是什么含义,这个用法还挺多的. > 我理解searchvalue是一个变量,但如何用,何时用不明白? > >> > 第二个: 同样在这个模版中,addresses_list.html开头的 > {% extends "base" %} > {% block content %} > {% load change_gender %} > 是什么含义? 如果自己写程序,如何想到还要加这些? > > 谢谢!!! > 建议仔细阅读django文档。 -- GoogleTalk: qcxhome at gmail.com MSN: qcxhome at hotmail.com My Space: tkdchen.spaces.live.com BOINC: boinc.berkeley.edu 中国分布式计算总站: www.equn.com
2007年03月24日 星期六 01:27
看template文档就全明白了。
{{  }} 是模版里面的变量。
{% %} 是模版里面命令。extends是继承、block是插入块等。
建议仔细的阅读django的文档,顺便也阅读一下《提问的智慧》,呵呵。
在 07-3-22,cuix<cuix在cert.org.cn> 写道:
> 
> 在limodou撰写的教程中,有一个"通讯录"例子,在addresses_list.html模版中,有两个地方不理解:
>
> 第一个: {{ searchvalue}} ,用2个大括号括起来是什么含义,这个用法还挺多的.
>            我理解searchvalue是一个变量,但如何用,何时用不明白?
>
> 
>
> 第二个: 同样在这个模版中,addresses_list.html开头的
> {% extends "base" %}
> {% block content %}
> {% load change_gender %}
> 是什么含义? 如果自己写程序,如何想到还要加这些?
>
> 谢谢!!!
>
> Django Step by Step
> « 第六章 Wiki例子 | table of contents | 第八章 通讯录的导入和导出 »
> 第七章 通讯录
>
> ________________________________
>
> cuix
> 2007-03-22
> _______________________________________________
> 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
>
Zeuux © 2025
京ICP备05028076号