Skip to content

Commit cbc4e05

Browse files
committed
translated several chunks. 35 TBDs left.
1 parent c28ccf5 commit cbc4e05

File tree

20 files changed

+356
-391
lines changed

20 files changed

+356
-391
lines changed

_ext/djangodocs.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@
1212
import sphinx.environment
1313
import sphinx.htmlwriter
1414

15+
def populate_index_to_rebuilds(app, doctree):
16+
app.builder.env.files_to_rebuild['index'] = set([])
17+
1518
def setup(app):
19+
app.connect('doctree-read', populate_index_to_rebuilds)
1620
app.add_crossref_type(
1721
directivename = "setting",
1822
rolename = "setting",

contents.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Django ドキュメント 目次
88

99
.. toctree::
1010
:maxdepth: 2
11-
11+
1212
intro/index
1313
topics/index
1414
howto/index

howto/custom-model-fields.txt

Lines changed: 33 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -445,13 +445,11 @@ Python オブジェクトをデータベース保存用の値に変換する
445445

446446
.. method:: get_db_prep_save(self, value)
447447

448-
.. TBD
449-
450-
Same as the above, but called when the Field value must be *saved* to the
451-
database. As the default implementation just calls ``get_db_prep_value``, you
452-
shouldn't need to implement this method unless your custom field need a special
453-
conversion when being saved that is not the same as the used for normal query
454-
parameters (which is implemented by ``get_db_prep_value``).
448+
前述のメソッドと同じですが、フィールドの値をデータベースに *保存* せねばな
449+
らないときに呼び出されます。デフォルトの実装では単に ``get_db_prep_value``
450+
を呼び出しています。従って、データベースにデータを保存するときに、
451+
(``get_db_prep_value`` で実装している) 通常のクエリパラメタと違うものを使わ
452+
ねばならないような特殊な状況を除き、このメソッドを実装する必要はありません。
455453

456454
.. _Preprocessing values before saving:
457455

@@ -654,44 +652,39 @@ parameters (which is implemented by ``get_db_prep_value``).
654652
:meth:`__unicode__` メソッドを定義しておき、 Python オブジェクトが自
655653
動的に文字列形式に変換されるようにしておけば、作業を大幅に減らせます。
656654

655+
``FileField`` のサブクラスを定義する
656+
=======================================
657657

658-
.. TBD
659-
660-
Writing a ``FileField`` subclass
661-
=================================
662-
663-
In addition to the above methods, fields that deal with files have a few other
664-
special requirements which must be taken into account. The majority of the
665-
mechanics provided by ``FileField``, such as controlling database storage and
666-
retrieval, can remain unchanged, leaving subclasses to deal with the challenge
667-
of supporting a particular type of file.
668-
669-
Django provides a ``File`` class, which is used as a proxy to the file's
670-
contents and operations. This can be subclassed to customize how the file is
671-
accessed, and what methods are available. It lives at
672-
``django.db.models.fields.files``, and its default behavior is explained in the
673-
:ref:`file documentation <ref-files-file>`.
658+
上に挙げたメソッドに加えて、ファイルを扱うフィールドを定義するときには、い
659+
くつか必要な条件があります。データベースストレージの操作やデータの取得など、
660+
フィールド定義に必要なメカニズムのほとんどは ``FileField`` で定義しています
661+
が、特定のタイプのファイルをサポートするための処理はサブクラスに委ねていま
662+
す。
674663

675-
Once a subclass of ``File`` is created, the new ``FileField`` subclass must be
676-
told to use it. To do so, simply assign the new ``File`` subclass to the special
677-
``attr_class`` attribute of the ``FileField`` subclass.
664+
Django はファイルのコンテンツや操作をプロキシする ``File`` クラスを提供して
665+
います。このクラスはサブクラス化でき、ファイルのアクセス方法やメソッドをカ
666+
スタマイズできます。 ``File`` クラスは ``django.db.models.fields.files`` で
667+
定義されており、デフォルトの動作は :ref:`ファイルクラスのドキュメント
668+
<ref-files-file>` で解説しています。
678669

679-
A few suggestions
680-
------------------
670+
``File`` のサブクラスを作ったら、 ``FileField`` サブクラスの ``attr_class``
671+
に指定して、 ``FileField`` サブクラスに指定のファイルクラスを使うよう指示し
672+
てください。
681673

682-
In addition to the above details, there are a few guidelines which can greatly
683-
improve the efficiency and readability of the field's code.
674+
アドバイス
675+
------------
684676

685-
1. The source for Django's own ``ImageField`` (in
686-
``django/db/models/fields/files.py``) is a great example of how to
687-
subclass ``FileField`` to support a particular type of file, as it
688-
incorporates all of the techniques described above.
677+
上に挙げた説明に加えて、カスタムフィールドのコードの効率や可読性を挙げるた
678+
めのガイドラインをいくつか示しておきます。
689679

690-
2. Cache file attributes wherever possible. Since files may be stored in
691-
remote storage systems, retrieving them may cost extra time, or even
692-
money, that isn't always necessary. Once a file is retrieved to obtain
693-
some data about its content, cache as much of that data as possible to
694-
reduce the number of times the file must be retrieved on subsequent
695-
calls for that information.
680+
1. Django の ``ImageField`` (``django/db/models/fields/files.py``) は、
681+
``FileField`` をサブクラス化して特定のファイルタイプをサポートしてい
682+
る素晴らしい例題です。このクラスでは、上に述べたテクニックを余すとこ
683+
ろ無く使っています。
696684

685+
2. 可能な限り、ファイルの属性をキャッシュしましょう。ファイルは遠隔のス
686+
トレージシステム上にあるので、ファイルデータの取得には時間もお金もか
687+
かります。しかも、常に必要なわけではありません。一度ファイルを取得し
688+
て、コンテンツに関するデータを収集したら、データ可能な限りキャッシュ
689+
して、以後のアクセスでファイルを再取得する回数を減らしましょう。
697690

howto/deployment/fastcgi.txt

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -393,33 +393,31 @@ Admin メディアファイルの提供
393393
法を考えておかねばなりません. :ref:`modpython <serving-the-admin-files>`
394394
での運用に関するドキュメントには,上記の構成でも使えるアドバイスがあります.
395395

396-
.. TBD
397-
398-
Forcing the URL prefix to a particular value
396+
URL のプレフィクス部分を特定の値にする
399397
============================================
400398

401-
Because many of these fastcgi-based solutions require rewriting the URL at
402-
some point inside the webserver, the path information that Django sees may not
403-
resemble the original URL that was passed in. This is a problem if the Django
404-
application is being served from under a particular prefix and you want your
405-
URLs from the ``{% url %}`` tag to look like the prefix, rather than the
406-
rewritten version, which might contain, for example, ``mysite.fcgi``.
407-
408-
Django makes a good attempt to work out what the real script name prefix
409-
should be. In particular, if the webserver sets the ``SCRIPT_URL`` (specific
410-
to Apache's mod_rewrite), or ``REDIRECT_URL`` (set by a few servers, including
411-
Apache + mod_rewrite in some situations), Django will work out the original
412-
prefix automatically.
413-
414-
In the cases where Django cannot work out the prefix correctly and where you
415-
want the original value to be used in URLs, you can set the
416-
``FORCE_SCRIPT_NAME`` setting in your main ``settings`` file. This sets the
417-
script name uniformly for every URL served via that settings file. Thus you'll
418-
need to use different settings files is you want different sets of URLs to
419-
have different script names in this case, but that is a rare situation.
420-
421-
As an example of how to use it, if your Django configuration is serving all of
422-
the URLs under ``'/'`` and you wanted to use this setting, you would set
423-
``FORCE_SCRIPT_NAME = ''`` in your settings file.
399+
FastCGI を使った設置方法は、ほとんどが URL をリライトしてウェブサーバ内部の
400+
別の場所を指すようにしています。このとき、 Django から見えるパス情報には、
401+
もともとの URL が反映されません。そのため、 Django アプリケーションを特定の
402+
プレフィクスの下で動かしていて、 ``{% url %}`` タグで表示される URL を、
403+
``mysite.fcgi`` のようなリライト後のものでなく、プレフィクスのついた URL に
404+
したいときに問題が生じます。
405+
406+
Django は実際のスクリプト名プレフィクスが何だったかをそれなりにうまく調べよ
407+
うとします。特に、ウェブサーバが ``SCRIPT_URL`` を設定する場合(Apache の
408+
modo_rewrite 特有の機能です) や、 ``REDIRECT_URL`` を設定する場合 (Apache
409+
mod_rewrite をある構成で使ったとき) には、もとのプレフィクスを自動的に
410+
見つけ出します。
411+
412+
Django がプレフィクスを正しく見付けられない場合や、リライト前の値を URL に
413+
使いたい場合には、設定ファイル中で :setting:`FORCE_SCRIPT_NAME` を設定して
414+
ください。この変数には、全ての URL に共通なスクリプト名を指定します。したがっ
415+
て、別々のスクリプト名を持った URL に対応するには個別に設定ファイルを用意せ
416+
ねばなりませんが、そのようなケースは稀でしょう。
417+
418+
例えば、全てのコンテンツを ``'/'`` 以下の URL で提供するように Django を構
419+
成しているなら、設定ファイルには ``FORCE_SCRIPT_NAME = ''`` と指定してくだ
420+
さい。
421+
424422

425423

howto/deployment/index.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
.. _howto-deployment-index:
22

3-
.. TBD
4-
5-
Deploying Django
6-
================
3+
Django のデプロイ
4+
===================
75

86
:revision-up-to: 8961 (1.0)
97

howto/deployment/modpython.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ import パスになるよう、自分の環境に合わせて置き換えて下
5555
:ref:`DJANGO_SETTINGS_MODULE <django-settings-module>` を渡して、
5656
mod_python にどこに設定ファイルがあるのか教えます。
5757

58-
.. TBD
59-
6058
.. versionadded:: 1.0
6159
``PythonOption django.root ...`` が新たに登場しました。
6260

howto/index.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
.. _howto-index:
22

3-
ハウツーガイド
3+
HOWTO ガイド
44
===============
55

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

8-
.. TBD
9-
10-
Here you'll find short answers to "How do I....?" types of questions. These
11-
how-to guides don't cover topics in depth -- you'll find that material in the
12-
:ref:`topics-index` and the :ref:`ref-index`. However, these guides will help
13-
you quickly accomplish common tasks.
8+
このセクションでは、「〜するにはどうしたら?」という種の質問に対する回答を
9+
扱っています。 HOWTO ガイドでは、それぞれの問題をあまり深く掘り下げて説明し
10+
ません。詳しい話題は、 :ref:`topics-index` や :ref:`ref-index` で扱っていま
11+
す。とはいえ、ここにあるガイドを読めば、よくある作業を簡単に実現できるはず
12+
です。
1413

1514
.. toctree::
1615
:maxdepth: 1
@@ -31,8 +30,9 @@ you quickly accomplish common tasks.
3130

3231
.. seealso::
3332

34-
The `Django community aggregator`_, where we aggregate content from the
35-
global Django community. Many writers in the aggregator write this sort of
36-
how-to material.
33+
`Django のコミュニティアグリゲータ <Django community aggregator>`_ では、
34+
世界中の Django コミュニティから寄せられたコンテンツを収集しています。
35+
アグリゲータに登録されている著者の多くが、このての HOWTO 文書を書いてい
36+
ます。
3737

3838
.. _django community aggregator: http://www.djangoproject.com/community/

internals/committers.txt

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
.. _internals-committers:
22

3-
.. TBD
4-
53
=================
6-
Django committers
4+
Django のコミッタ
75
=================
86

97
:revision-up-to: 8961 (1.0)
108

11-
The original team
9+
オリジナルチーム
1210
=================
1311

14-
Django originally started at World Online, the Web department of the `Lawrence
15-
Journal-World`_ of Lawrence, Kansas, USA.
12+
Django プロジェクトは、米国ローレンス州カンザスにある `Lawrence
13+
Journal-World`_ 社の Web 開発部門、 World Online で生まれました。
1614

1715
`Adrian Holovaty`_
1816
Adrian はジャーナリズムのバックグラウンドを持った Web 開発者です。ジャー
@@ -34,14 +32,16 @@ Journal-World`_ of Lawrence, Kansas, USA.
3432

3533
イングランドのブライトン在住です。
3634

35+
.. TBD
36+
3737
`Jacob Kaplan-Moss`_
38-
Jacob is a software architect at `Whiskey Media`_, one of those newfangled
39-
Web 1.0 companies you've read so much about. A good deal of Jacob's work
40-
time is devoted to working on Django. Jacob previous worked for the Lawrence
41-
Journal-World, where he was the lead developer of Ellington, a commercial
42-
web publishing platform for media companies.
38+
Jacob は最新の Web 1.0 企業の一つ、 `Whiskey Media`_ のソフトウェアアー
39+
キテクトです。 Jacob の仕事時間の大半は、 Django に関する仕事に割り当て
40+
られています。Jacob はかつて Lawrence Journal-World で働いていましたが、
41+
当時はメディア企業向けの商用パブリッシングプラットフォームである
42+
Ellington のリードデベロッパでした。
4343

44-
Jacob lives in Lawrence, Kansas, USA.
44+
ローレンス州カンザス在住です。
4545

4646
`Wilson Miner`_
4747
Django をかっこよく見せているのは Wilson のデザインの力です。今あなたが
@@ -61,8 +61,8 @@ Journal-World`_ of Lawrence, Kansas, USA.
6161
.. _whiskey media: http://whiskeymedia.com/
6262
.. _wilson miner: http://wilsonminer.com/
6363

64-
Current developers
65-
==================
64+
現在の開発者
65+
=============
6666

6767
Currently, Django is led by a team of volunteers from around the globe.
6868

intro/whatsnext.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@ Django のドキュメントは、用途に応じていくつかの塊に分け
5656

5757
* ウェブ開発に必要な知識は、いくつもの領域にまたがって広く、浅く分布し
5858
ているものです。 このセクションには、「〜をするにはどうしたらよいです
59-
か?」といった質問に答える、 :ref:`ハウツー <howto-index>` が書かれて
59+
か?」といった質問に答える、 :ref:`HOWTO <howto-index>` が書かれて
6060
います。例えば、 :ref:`Django で PDF を生成する方法
6161
<howto-outputting-pdf>` や、 :ref:`テンプレートタグを自作する方法
6262
<howto-custom-template-tags>` などです。
6363

6464
よくある質問は、これとは別に :ref:`FAQ <faq-index>` で扱っています。
6565

66-
* ガイドやハウツードキュメントは、 Django の全てのクラスや関数、メソッ
66+
* ガイドや HOWTO ドキュメントは、 Django の全てのクラスや関数、メソッ
6767
ドを解説しているわけではありません。 Django を学ぼうとする人に最初か
6868
ら全てを教えようとしても、溢れてしまうからです。その代わりに、個々の
6969
クラスや関数、メソッド、モジュールの解説を :ref:`リファレンス

0 commit comments

Comments
 (0)