Skip to content

Commit be6e6dc

Browse files
committed
translated small blocks. 111 blocks left.
1 parent db6d3e6 commit be6e6dc

File tree

12 files changed

+186
-208
lines changed

12 files changed

+186
-208
lines changed

ref/settings.txt

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -506,35 +506,33 @@ FILE_UPLOAD_TEMP_DIR
506506

507507
詳しくは :ref:`topics-files` を参照してください。
508508

509-
.. TBD
510-
511509
.. setting:: FILE_UPLOAD_PERMISSIONS
512510

513511
FILE_UPLOAD_PERMISSIONS
514512
-----------------------
515513

516-
Default: ``None``
514+
デフォルト値: ``None``
517515

518-
The numeric mode (i.e. ``0644``) to set newly uploaded files to. For
519-
more information about what these modes mean, see the `documentation for
520-
os.chmod`_
516+
アップロードされたファイルに設定するファイルモードで、数字で表現
517+
(例: ``0644``) します。ファイルモードの意味は `os.chmod のドキュメント`_ を
518+
参照してください。
521519

522-
If this isn't given or is ``None``, you'll get operating-system
523-
dependent behavior. On most platforms, temporary files will have a mode
524-
of ``0600``, and files saved from memory will be saved using the
525-
system's standard umask.
520+
この値を設定しないか、 ``None`` にすると、アップロードされたファイルのモー
521+
ドはオペレーティングシステムに依存します。ほとんどのプラットフォームでは、
522+
一時ファイルのファイルモードは ``0600`` で、メモリからファイルにデータを書
523+
き出すときにはシステム標準の umask を使います。
526524

527525
.. warning::
528526

529-
**Always prefix the mode with a 0.**
530-
531-
If you're not familiar with file modes, please note that the leading
532-
``0`` is very important: it indicates an octal number, which is the
533-
way that modes must be specified. If you try to use ``644``, you'll
534-
get totally incorrect behavior.
535-
527+
**ファイルモードの先頭には常に ``0`` をつけてください**.
536528

529+
ファイルモードにあまりくわしくないのなら、先頭の ``0`` がとても
530+
重要だということに注意してください。先頭の 0 は、値が 8 進数で
531+
あることを示しています。 ``644`` のように指定すると、全くおかし
532+
な挙動になってしまうでしょう。
533+
537534
.. _documentation for os.chmod: http://docs.python.org/lib/os-file-dir.html
535+
.. _`os.chmod のドキュメント`: `documentation for os.chmod`_
538536

539537
.. setting:: FIXTURE_DIRS
540538

ref/templates/builtins.txt

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,10 @@
77

88
:revision-up-to: 8961 (1.0)
99

10-
.. TBD
11-
12-
13-
This document describes Django's built-in template tags and filters. It is
14-
recommended that you use the :ref:`automatic documentation
15-
<template-built-in-reference>`, if available, as this will also include
16-
documentation for any custom tags or filters installed.
10+
このドキュメントでは、 Django の組み込みテンプレートタグおよびフィルタにつ
11+
いて解説しています。 また、 :ref:`自動生成ドキュメント
12+
<template-built-in-reference>` を使えば、インストールされている組み込みタグ
13+
とカスタムタグのドキュメントを読めるのでお勧めです。
1714

1815
.. _ref-templates-builtins-tags:
1916
.. _Built-in tag reference:
@@ -173,7 +170,6 @@ for
173170
{% endfor %}
174171
</ul>
175172

176-
のようにします。
177173

178174
``{% for obj in list reversed %}`` のようにすると、リストに対して逆順のルー
179175
プを実行できます。
@@ -685,23 +681,21 @@ DRY 則の侵犯を避けられます::
685681
:ref:`名前つき URL パターン <naming-url-patterns>` を使っている場合、
686682
``url`` タグにはビューのパス名の代わりにパターン名を指定できます。
687683

688-
.. TBD
684+
逆変換しようとしている URL が存在しない場合、 :exc:`NoReverseMatch` 例外を
685+
送出するため、エラーページが表示されます。
689686

690-
Note that if the URL you're reversing doesn't exist, you'll get an
691-
:exc:`NoReverseMatch` exception raised, which will cause your site to display an
692-
error page.
687+
.. versionadded:: 1.0
693688

694-
**New in development verson:** If you'd like to retrieve a URL without displaying it,
695-
you can use a slightly different call:
689+
URL を表示せず、取り出したいだけなら、以下のような形式で呼び出せます:
696690

697691
.. code-block:: html+django
698692

699693
{% url path.to.view arg, arg2 as the_url %}
700694

701695
<a href="{{ the_url }}">I'm linking to {{ the_url }}</a>
702696

703-
This ``{% url ... as var %}`` syntax will *not* cause an error if the view is
704-
missing. In practice you'll use this to link to views that are optional:
697+
``{% url ... as var %}`` の形式は、 URL からビューを解決できなくてもエラー
698+
を送出 *しません* 。従って、ビューへのリンクは以下のようにも書けます:
705699

706700
.. code-block:: html+django
707701

topics/http/file-uploads.txt

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -157,26 +157,28 @@ Django がアップロードされたファイルを扱うとき、ファイル
157157
デフォルト値はシステム標準の一時ファイルディレクトリです
158158
(UNIX ライクのシステムでは ``/tmp`` です)。
159159

160-
.. TBD
161-
162160
:setting:`FILE_UPLOAD_PERMISSIONS`
163-
The numeric mode (i.e. ``0644``) to set newly uploaded files to. For
164-
more information about what these modes mean, see the `documentation for
165-
os.chmod`_
161+
アップロードされたファイルに設定するファイルモードで、数字で表現
162+
(例: ``0644``) します。ファイルモードの意味は
163+
`os.chmod のドキュメント`_ を参照してください。
164+
165+
.. _documentation for os.chmod: http://docs.python.org/lib/os-file-dir.html
166+
.. _`os.chmod のドキュメント`: `documentation for os.chmod`_
166167

167-
If this isn't given or is ``None``, you'll get operating-system
168-
dependent behavior. On most platforms, temporary files will have a mode
169-
of ``0600``, and files saved from memory will be saved using the
170-
system's standard umask.
168+
この値を設定しないか、 ``None`` にすると、アップロードされたファイ
169+
ルのモードはオペレーティングシステムに依存します。ほとんどのプラッ
170+
トフォームでは、一時ファイルのファイルモードは ``0600`` で、メモリ
171+
からファイルにデータを書き出すときにはシステム標準の umask を使いま
172+
す。
171173

172174
.. warning::
173175

174-
If you're not familiar with file modes, please note that the leading
175-
``0`` is very important: it indicates an octal number, which is the
176-
way that modes must be specified. If you try to use ``644``, you'll
177-
get totally incorrect behavior.
176+
ファイルモードにあまりくわしくないのなら、先頭の ``0`` がとても
177+
重要だということに注意してください。先頭の 0 は、値が 8 進数で
178+
あることを示しています。 ``644`` のように指定すると、全くおかし
179+
な挙動になってしまうでしょう。
178180

179-
**Always prefix the mode with a ``0``.**
181+
**ファイルモードの先頭には常に ``0`` をつけてください**.
180182

181183
:setting:`FILE_UPLOAD_HANDLERS`
182184
アップロードファイルを処理する実際のハンドラです。
@@ -220,22 +222,20 @@ Django がアップロードされたファイルを扱うとき、ファイル
220222
アップロードファイルがディスクに一時保存されているときにのみ使える
221223
メソッドで、一時ファイルの完全なパスを返します。
222224

223-
.. TBD
224-
225225
.. note::
226226

227-
Like regular Python files, you can read the file line-by-line simply by
228-
iterating over the uploaded file:
227+
通常の Python のファイルオブジェクトと同じく、アップロードファイルをイ
228+
テレータとして扱うと、ファイルの内容を一行づつ読めます:
229229

230230
.. code-block:: python
231231

232232
for line in uploadedfile:
233233
do_something_with(line)
234-
235-
However, *unlike* standard Python files, :class:`UploadedFile` only
236-
understands ``\n`` (also known as "Unix-style") line endings. If you know
237-
that you need to handle uploaded files with different line endings, you'll
238-
need to do so in your view.
234+
235+
しかし、標準の Python ファイルとは *違って* 、 :class:`UploadedFile`
236+
改行文字として ``\n`` (いわゆる Unix形式) しか認識しません。 ``\n`` 以
237+
外の改行で終端されたアップロードファイルを処理する必要があるのなら、ビュー
238+
内で適切に処理する必要があります。
239239

240240
.. _Upload Handlers:
241241

topics/http/index.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
.. _topics-http-index:
22

3-
Handling HTTP requests
3+
HTTP リクエストの処理
44
======================
55

66
:revision-up-to: 8961 (1.0)
77

8-
.. TBD
9-
10-
Information on handling HTTP requests in Django:
8+
このセクションでは、 Django における HTTP リクエスト処理に関する情報を扱っ
9+
ています:
1110

1211
.. toctree::
1312
:maxdepth: 1

topics/http/middleware.txt

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -138,29 +138,29 @@ Django はビューが例外を送出した際に ``process_exception()`` を呼
138138
をそのままブラウザに返します。それ以外の場合、デフォルトの例外処理を起動し
139139
ます。
140140

141-
.. TBD
142-
143141
``__init__``
144142
------------
145143

146-
Most middleware classes won't need an initializer since middleware classes are
147-
essentially placeholders for the ``process_*`` methods. If you do need some
148-
global state you may use ``__init__`` to set up. However, keep in mind a couple
149-
of caveats:
144+
ほとんどのミドルウェアクラスは、実質的に単なる ``process_*`` メソッドの置き
145+
場でしかないので、初期化メソッドは必要ありません。ミドルウェアのグローバル
146+
な状態を保存するのに ``__init__`` メソッドを使ってもかまいませんが、以下の
147+
点に注意してください:
148+
149+
* Django はミドルウェアクラスを引数なしで初期化するので、 ``__init__``
150+
には必須の引数を定義できません。
151+
152+
* ``process_*`` メソッドはリクエストごとに呼び出されますが、
153+
``__init__`` は Web サーバの起動時に *一度* しか呼び出されません。
150154

151-
* Django initializes your middleware without any arguments, so you can't
152-
define ``__init__`` as requiring any arguments.
153-
154-
* Unlike the ``process_*`` methods which get called once per request,
155-
``__init__`` gets called only *once*, when the web server starts up.
155+
.. Marking middleware as unused
156156

157-
Marking middleware as unused
158-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
157+
ミドルウェアを動的に有効にする
158+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
159159

160-
It's sometimes useful to determine at run-time whether a piece of middleware
161-
should be used. In these cases, your middleware's ``__init__`` method may raise
162-
``django.core.exceptions.MiddlewareNotUsed``. Django will then remove that piece
163-
of middleware from the middleware process.
160+
ミドルウェアを使うかどうかを実行時に決められると便利なことがあります。ミド
161+
ルウェアの ``__init__`` メソッドで
162+
:exc:`django.core.exceptions.MiddlewareNotUsed` を送出すると、 Django はそ
163+
のミドルウェアを処理から外します。
164164

165165
.. _Guidelines:
166166

topics/http/sessions.txt

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -135,17 +135,14 @@ Django のキャッシュシステムにセッションデータを保存する
135135

136136
また、以下のメソッドを持ちます:
137137

138-
.. TBD
139-
140138
* ``flush()``
141139

142140
.. versionadded:: 1.0
143141

144-
Delete the current session data from the database and regenerate the
145-
session key value that is sent back to the user in the cookie. This is
146-
used if you want to ensure that the previous session data can't be
147-
accessed again from the user's browser (for example, the
148-
``django.contrib.auth.logout()`` method calls it).
142+
現在のセッションデータをデータベースから削除し、後でクッキーに入れて
143+
ユーザに送り返すために新たなセッションキーを生成します。ユーザの使っ
144+
ているブラウザに、以前のセッションデータにアクセスさせたくない場合に
145+
使います (例えば ``django.contrib.auth.logout()`` で呼び出されます)。
149146

150147
* ``set_test_cookie()``
151148

@@ -154,7 +151,6 @@ Django のキャッシュシステムにセッションデータを保存する
154151
ザがリクエストを送信してくるまでテストは行えません。詳しくは後述の
155152
「 `テストクッキーを設定する`_ 」を参照してください。
156153

157-
158154
* ``test_cookie_worked()``
159155

160156
ユーザのブラウザがテストクッキーを受け入れたかどうかに応じて ``True``
@@ -263,12 +259,10 @@ Django のキャッシュシステムにセッションデータを保存する
263259
pass
264260
return HttpResponse("You're logged out.")
265261

266-
.. TBD
267-
268-
The standard ``django.contrib.auth.logout()`` function actually does a bit
269-
more than this to prevent inadvertent data leakage. It calls
270-
``request.session.flush()``. We are using this example as a demonstration of
271-
how to work with session objects, not as a full ``logout()`` implementation.
262+
実際には、標準の ``django.contrib.auth.logout()`` は、うっかりデータが漏洩
263+
してしまうのを防ぐために、 ``request.session.flush()`` を呼び出しています。
264+
上の例はセッションオブジェクトの仕組みを説明するためのもので、完全な
265+
``logout()`` の実装ではありません。
272266

273267
.. _Setting test cookies:
274268

topics/http/urls.txt

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -665,16 +665,10 @@ reverse()
665665
.. _URL pattern name: `Naming URL patterns`_
666666
.. _`URL パターン名`: `URL pattern name`_
667667

668-
.. TBD
669-
670-
The ``reverse()`` function can reverse a large variety of regular expression
671-
patterns for URLs, but not every possible one. The main restriction at the
672-
moment is that the pattern cannot contain alternative choices using the
673-
vertical bar (``"|"``) character. You can quite happily use such patterns for
674-
matching against incoming URLs and sending them off to views, but you cannot
675-
reverse such patterns.
676-
677-
668+
``reverse()`` 関数は大抵の正規表現パターンを URL に逆変換できますが、全てと
669+
は限りません。今のところ、パターン中に垂直バー (``"|"``) を含められません。
670+
垂直バーを含むパターンは、 URL からビューへのマッチングには問題なく使えます
671+
が、パターンの逆変換はできないので注意してください。
678672

679673
permalink()
680674
-----------

0 commit comments

Comments
 (0)