Django Book 翻译
菜单>:
TOC
返回
原文:
Clearly, this line of thought is flawed. Not only would this result in redundant view functions, but also the application is fundamentally limited to supporting only the predefined hour rangesone, two, three, or four hours. If, all of a sudden, we wanted to create a page that displayed the time *five* hours into the future, wed have to create a separate view and URLconf line for that, furthering the duplication and insanity. We need to do some abstraction here.
翻译:
很明显,这样处理是不太妥当的。不但有很多冗余的视图函数,而且整个应用也被限制了只支持 预先定义好的时间段,2小时,3小时,或者4小时。如果哪天我们要实现 *5* 小时,我们就 不得不再单独创建新的视图函数和配置URL,既重复又混乱。我们需要在这里做一点抽象,提取 一些共同的东西出来。
备注:
译者: