Django Book 翻译
菜单>:
TOC
返回
原文:
Just as Chapter 3 detailed a dumb way to produce output within a view (by hard-coding the text directly within the view), theres a dumb way to retrieve data from a database in a view. Its simple: just use any existing Python library to execute an SQL query and do something with the results.
翻译:
正如第三章详细介绍的那个在视图中输出 HTML 的笨方法(通过在视图里对文本直接硬编码HTML),在视图中也有笨方法可以从数据库中获取数据。很简单:用现有的任何 Python 类库执行一条 SQL 查询并对结果进行一些处理。
备注:
译者: