Django 官方教程翻译项目CN) 构建 现在我们将用额外的元数据来定义你的模型 —— 本质上是你的数据库布局。 设计哲学 模型是你数据的简单明确的描述。它包含了储存的数据所必要的字段和行为。Django 遵循 DRY 原则。它的目标是让你只需要在一 个地方定义数据模型,Django 就能自动从中导出迁移代码。 来介绍一下迁移 - 举个例子,不像 Ruby On Rails,Django 的迁移代码全部都是从你的模型文件导出的,它本质上只是个历史 坏他们的)。如果你想作为一个 Django 程序 员谋生的话,你必须擅长编写测试! 测试有几种不同的应用方法。 一些开发者遵循 测试驱动开发(test-driven development)的原则,他们在写代码之前先写测 试。这种方法看起来有点反直觉,但事实上,这和大多数人日常的做法是相吻合的。我们会先描述一 个问题,然后写代码来解决它。「测试驱动」的开发方法只是将问题的描述抽象为了 Python0 码力 | 103 页 | 1.86 MB | 1 年前3
Django 4.0.x DocumentationIn older versions, new callbacks added while executing transaction.on_commit() callbacks were not cap- tured. LiveServerTestCase class LiveServerTestCase LiveServerTestCase does basically the same as buffer_with_style(width, quadsegs=8, end_cap_style=1, join_style=1, mitre_limit=5.0) Same as buffer(), but allows customizing the style of the buffer. • end_cap_style can be round (1), flat (2), or square0 码力 | 2248 页 | 7.90 MB | 1 年前3
Django 3.0.x Documentationassigns the HttpRequest to the view’s request attribute, and any positional and/or keyword arguments cap- tured from the URL pattern to the args and kwargs attributes, respectively. Then dispatch() is called buffer_with_style(width, quadsegs=8, end_cap_style=1, join_style=1, mitre_limit=5.0) Same as buffer(), but allows customizing the style of the buffer. • end_cap_style can be round (1), flat (2), or square0 码力 | 2002 页 | 6.73 MB | 1 年前3
Django 3.1.x Documentationassigns the HttpRequest to the view’s request attribute, and any positional and/or keyword arguments cap- tured from the URL pattern to the args and kwargs attributes, respectively. Then dispatch() is called buffer_with_style(width, quadsegs=8, end_cap_style=1, join_style=1, mitre_limit=5.0) Same as buffer(), but allows customizing the style of the buffer. • end_cap_style can be round (1), flat (2), or square0 码力 | 2053 页 | 6.92 MB | 1 年前3
Django 5.1.2 Documentationassigns the HttpRequest to the view’s request attribute, and any positional and/or keyword arguments cap- tured from the URL pattern to the args and kwargs attributes, respectively. Then dispatch() is called buffer_with_style(width, quadsegs=8, end_cap_style=1, join_style=1, mitre_limit=5.0) Same as buffer(), but allows customizing the style of the buffer. • end_cap_style can be round (1), flat (2), or square0 码力 | 2923 页 | 9.62 MB | 1 年前3
Django 5.1 Documentationassigns the HttpRequest to the view’s request attribute, and any positional and/or keyword arguments cap- tured from the URL pattern to the args and kwargs attributes, respectively. Then dispatch() is called buffer_with_style(width, quadsegs=8, end_cap_style=1, join_style=1, mitre_limit=5.0) Same as buffer(), but allows customizing the style of the buffer. • end_cap_style can be round (1), flat (2), or square0 码力 | 2917 页 | 9.59 MB | 1 年前3
Django 4.1.x Documentationassigns the HttpRequest to the view’s request attribute, and any positional and/or keyword arguments cap- tured from the URL pattern to the args and kwargs attributes, respectively. Then dispatch() is called buffer_with_style(width, quadsegs=8, end_cap_style=1, join_style=1, mitre_limit=5.0) Same as buffer(), but allows customizing the style of the buffer. • end_cap_style can be round (1), flat (2), or square0 码力 | 2777 页 | 9.32 MB | 1 年前3
Django 5.0.x Documentationassigns the HttpRequest to the view’s request attribute, and any positional and/or keyword arguments cap- tured from the URL pattern to the args and kwargs attributes, respectively. Then dispatch() is called buffer_with_style(width, quadsegs=8, end_cap_style=1, join_style=1, mitre_limit=5.0) Same as buffer(), but allows customizing the style of the buffer. • end_cap_style can be round (1), flat (2), or square0 码力 | 2878 页 | 9.60 MB | 1 年前3
Django 4.2.x Documentationassigns the HttpRequest to the view’s request attribute, and any positional and/or keyword arguments cap- tured from the URL pattern to the args and kwargs attributes, respectively. Then dispatch() is called buffer_with_style(width, quadsegs=8, end_cap_style=1, join_style=1, mitre_limit=5.0) Same as buffer(), but allows customizing the style of the buffer. • end_cap_style can be round (1), flat (2), or square0 码力 | 2842 页 | 9.47 MB | 1 年前3
Django 2.1.x Documentationbuffer_with_style(width, quadsegs=8, end_cap_style=1, join_style=1, mitre_limit=5.0) Same as buffer(), but allows customizing the style of the buffer. • end_cap_style can be round (1), flat (2), or square0 码力 | 1910 页 | 6.49 MB | 1 年前3
共 23 条
- 1
- 2
- 3













