Skip to content

Commit d57eecc

Browse files
committed
add 'Outputting PDFs with Django' translation
1 parent 901356a commit d57eecc

2 files changed

Lines changed: 7 additions & 17 deletions

File tree

‎Django/1.9/README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ Django有“视图(view)”的概念,用来封装负责处理用户请求并
9696
[_Using mixins_](https://docs.djangoproject.com/en/1.9/topics/class-based-views/mixins/) |
9797
[API参考](https://docs.djangoproject.com/en/1.9/ref/class-based-views/) |
9898
[_Flattened index_](https://docs.djangoproject.com/en/1.9/ref/class-based-views/flattened-index/)
99-
* **高级**: [生成CSV](https://docs.djangoproject.com/en/1.9/howto/outputting-csv/) |
100-
[生成PDF](https://docs.djangoproject.com/en/1.9/howto/outputting-pdf/)
99+
* **高级**: [生成CSV](./howto/使用Django输出CSV.md) |
100+
[生成PDF](./howto/使用Django输出PDF.md)
101101
* **Middleware:**
102102
[概述](./topics/http/中间件.md) |
103103
[内置中间件类](https://docs.djangoproject.com/en/1.9/ref/middleware/)

‎Others/在Python中进行防御性编程.md‎

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -278,27 +278,17 @@ def main():
278278
如果在生产代码中启用,这个异常文件可能包含优秀的调试日志。它开启了挖掘日志数据很大的令人兴奋的可能性:
279279

280280
* 发现用户正尝试我们不曾测试的特性的不同排列,或者甚至考虑,什么会导致新特性的增加,从而使得普通的用例更容易。
281-
* Find common errors due to a misunderstanding that users have about how
282-
the application works, which could lead to writing better user
283-
documentation.
281+
* 由于用户对于应用程序的工作原理的误解而发现的常见错误,这可能导致写出更好的用户文档。
284282

285283
4. 与断言更高级的组合
286284

287-
You can also use assertions in tandem with your logging. For example, you
288-
could run your application in the default debug mode then catch and
289-
log your `AssertionError` to a different file. This could lead to even more
290-
data mining possibilities such as finding out an environmental assumption
291-
you have about the platform your running in.
285+
你还可以将断言和日志串联使用。例如,你可以在默认的debug模式下运行你的应用,然后捕抓记录`AssertionError`到一个不同的文件中。这可以导致更多的数据挖掘的可能,例如找到关于你正运行的平台的一个环境假设。
292286

293-
These are just a few uses for logging in the context of Defensive
294-
Programming. In fact, you could use logging to create low-fidelity
295-
solutions for all sorts of problems, which is another post all in its own.
296-
[2]
287+
这只是在防御性编程的情况下日志的几个用途。事实上,你可以使用日志为各种各样的问题创造低保真解决方案,这就是另一个文章的事了。[2]
297288

298289
### 日志的缺点
299290

300-
Logging suffers from many of the same downsides as asserts. However, logging's
301-
additional flexibility comes with additional baggage to consider.
291+
日志有着许多与断言相同的缺点。然而,伴随着需要额外考虑的东西,日志有其额外的灵活性。
302292

303293
1. Difficulty managing consistent levels
304294

@@ -310,7 +300,7 @@ The best solution is to commit guidelines alongside your code in a
310300
style guide. Then, there is some project-specific documentation for
311301
newcomers to refer to when adding log messages.
312302

313-
2. Design of multiple loggers
303+
2. 多个logger的设计
314304

315305
The [logging module](http://docs.python.org/2/library/logging.html) is
316306
extremely flexible, but that flexibility comes at a cost. Logging

0 commit comments

Comments
 (0)