Skip to content

Commit 5c0a705

Browse files
committed
Translated 'ref/exceptions.txt' (#75)
1 parent 0c50434 commit 5c0a705

File tree

1 file changed

+183
-75
lines changed

1 file changed

+183
-75
lines changed

ref/exceptions.txt

Lines changed: 183 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,151 +1,259 @@
1-
=================
2-
Django Exceptions
3-
=================
1+
.. =================
2+
Django Exceptions
3+
=================
4+
5+
=============
6+
Django の例外
7+
=============
8+
9+
:revision-up-to: 17812 (1.4)
410

5-
:revision-up-to: 17812 (1.4) unfinished
11+
.. Django raises some Django specific exceptions as well as many standard
12+
Python exceptions.
613

7-
Django raises some Django specific exceptions as well as many standard
8-
Python exceptions.
14+
Django は多くの Python 標準の例外に加え、いくつかの Django
15+
固有の例外を送出します。
916

10-
Django-specific Exceptions
11-
==========================
17+
.. Django-specific Exceptions
18+
==========================
19+
20+
Django 固有の例外
21+
=================
1222

1323
.. module:: django.core.exceptions
1424
:synopsis: Django specific exceptions
1525

16-
ObjectDoesNotExist and DoesNotExist
17-
-----------------------------------
26+
.. ObjectDoesNotExist and DoesNotExist
27+
-----------------------------------
28+
29+
ObjectDoesNotExist と DoesNotExist
30+
----------------------------------
1831
.. exception:: DoesNotExist
1932
.. exception:: ObjectDoesNotExist
2033

21-
The :exc:`DoesNotExist` exception is raised when an object is not found
22-
for the given parameters of a query.
34+
.. The :exc:`DoesNotExist` exception is raised when an object is not found
35+
for the given parameters of a query.
2336

24-
:exc:`ObjectDoesNotExist` is defined in :mod:`django.core.exceptions`.
25-
:exc:`DoesNotExist` is a subclass of the base :exc:`ObjectDoesNotExist`
26-
exception that is provided on every model class as a way of
27-
identifying the specific type of object that could not be found.
37+
:exc:`DoesNotExist` 例外は指定されたクエリーパラメータでオブジェクトが
38+
見つからなかったときに送出されます。
2839

29-
See :meth:`~django.db.models.query.QuerySet.get()` for further information
30-
on :exc:`ObjectDoesNotExist` and :exc:`DoesNotExist`.
40+
.. :exc:`ObjectDoesNotExist` is defined in :mod:`django.core.exceptions`.
41+
:exc:`DoesNotExist` is a subclass of the base :exc:`ObjectDoesNotExist`
42+
exception that is provided on every model class as a way of
43+
identifying the specific type of object that could not be found.
44+
45+
:exc:`ObjectDoesNotExist` は :mod:`django.core.exceptions`
46+
の中で定義されています。:exc:`DoesNotExist` は、:exc:`ObjectDoesNotExist`
47+
例外をベースにしたサブクラスです。これは、どのタイプのオブジェクトを
48+
見つけられなかったのかを特定する手段として全モデルクラスで提供されています
49+
(訳注: モデルクラス ``Foo`` と ``Bar`` がある場合、 ``Foo.DoesNotExist``
50+
および ``Bar.DoesNotExist`` という ``ObjectDoesNotExist``
51+
を継承したクラスが定義されます)。
52+
53+
.. See :meth:`~django.db.models.query.QuerySet.get()` for further information
54+
on :exc:`ObjectDoesNotExist` and :exc:`DoesNotExist`.
55+
56+
:exc:`ObjectDoesNotExist` と :exc:`DoesNotExist` のさらなる情報について、
57+
:meth:`~django.db.models.query.QuerySet.get()` を参照してください。
3158

3259
MultipleObjectsReturned
3360
-----------------------
3461
.. exception:: MultipleObjectsReturned
3562

36-
The :exc:`MultipleObjectsReturned` exception is raised by a query if only
37-
one object is expected, but multiple objects are returned. A base version
38-
of this exception is provided in :mod:`django.core.exceptions`; each model
39-
class contains a subclassed version that can be used to identify the
40-
specific object type that has returned multiple objects.
63+
.. The :exc:`MultipleObjectsReturned` exception is raised by a query if only
64+
one object is expected, but multiple objects are returned. A base version
65+
of this exception is provided in :mod:`django.core.exceptions`; each model
66+
class contains a subclassed version that can be used to identify the
67+
specific object type that has returned multiple objects.
68+
69+
:exc:`MultipleObjectsReturned` 例外は、一つのオブジェクトが期待されるにも
70+
関わらず複数のオブジェクトが得られた場合に、クエリーによって送出されます。
71+
この例外のベースとなるバージョンは :mod:`django.core.exceptions` の中で
72+
定義されています。そして各モデルクラスはそれをサブクラス化した例外を
73+
含んでおり、どのタイプのオブジェクトが複数のオブジェクトを
74+
返したのかを特定するために使えます
75+
(訳注: モデルクラス ``Foo`` と ``Bar`` がある場合、送出された例外が
76+
``Foo.MultipleObjectsReturned`` であれば複数の ``Foo`` のオブジェクトが
77+
返されたと判断できます)。
4178

42-
See :meth:`~django.db.models.query.QuerySet.get()` for further information.
79+
.. See :meth:`~django.db.models.query.QuerySet.get()` for further information.
80+
81+
さらなる情報について :meth:`~django.db.models.query.QuerySet.get()`
82+
を参照してください。
4383

4484
SuspiciousOperation
4585
-------------------
4686
.. exception:: SuspiciousOperation
4787

48-
The :exc:`SuspiciousOperation` exception is raised when a user has performed
49-
an operation that should be considered suspicious from a security perspective,
50-
such as tampering with a session cookie.
88+
.. The :exc:`SuspiciousOperation` exception is raised when a user has performed
89+
an operation that should be considered suspicious from a security perspective,
90+
such as tampering with a session cookie.
91+
92+
:exc:`SuspiciousOperation` 例外は、セキュリティ観点上、不審と考えられる
93+
操作をユーザが行った場合に送出されます。たとえば、セッションクッキーが
94+
改変された場合などです。
5195

5296
PermissionDenied
5397
----------------
5498
.. exception:: PermissionDenied
5599

56-
The :exc:`PermissionDenied` exception is raised when a user does not have
57-
permission to perform the action requested.
100+
.. The :exc:`PermissionDenied` exception is raised when a user does not have
101+
permission to perform the action requested.
102+
103+
:exc:`PermissionDenied` 例外は、要求したアクションを実行する権限をユーザが
104+
持っていない場合に送出されます。
58105

59106
ViewDoesNotExist
60107
----------------
61108
.. exception:: ViewDoesNotExist
62109

63-
The :exc:`ViewDoesNotExist` exception is raised by
64-
:mod:`django.core.urlresolvers` when a requested view does not exist.
110+
.. The :exc:`ViewDoesNotExist` exception is raised by
111+
:mod:`django.core.urlresolvers` when a requested view does not exist.
112+
113+
:exc:`ViewDoesNotExist` 例外は、要求されたビューが存在しない場合に
114+
:mod:`django.core.urlresolvers` によって送出されます。
65115

66116
MiddlewareNotUsed
67117
-----------------
68118
.. exception:: MiddlewareNotUsed
69119

70-
The :exc:`MiddlewareNotUsed` exception is raised when a middleware is not
71-
used in the server configuration.
120+
.. The :exc:`MiddlewareNotUsed` exception is raised when a middleware is not
121+
used in the server configuration.
122+
123+
:exc:`MiddlewareNotUsed` 例外は、サーバ設定にあるミドルウェアの中に
124+
使われていないものがある場合に送出されます。
72125

73126
ImproperlyConfigured
74127
--------------------
75128
.. exception:: ImproperlyConfigured
76129

77-
The :exc:`ImproperlyConfigured` exception is raised when Django is
78-
somehow improperly configured -- for example, if a value in ``settings.py``
79-
is incorrect or unparseable.
130+
.. The :exc:`ImproperlyConfigured` exception is raised when Django is
131+
somehow improperly configured -- for example, if a value in ``settings.py``
132+
is incorrect or unparseable.
133+
134+
:exc:`ImproperlyConfigured` 例外は、 Django の設定の何かが正しくない場合に
135+
送出されます -- たとえば ``settings.py`` の値が不正であったり、
136+
書式不正である場合が挙げられます。
80137

81138
FieldError
82139
----------
83140
.. exception:: FieldError
84141

85-
The :exc:`FieldError` exception is raised when there is a problem with a
86-
model field. This can happen for several reasons:
87-
88-
- A field in a model clashes with a field of the same name from an
89-
abstract base class
90-
- An infinite loop is caused by ordering
91-
- A keyword cannot be parsed from the filter parameters
92-
- A field cannot be determined from a keyword in the query
93-
parameters
94-
- A join is not permitted on the specified field
95-
- A field name is invalid
96-
- A query contains invalid order_by arguments
142+
.. The :exc:`FieldError` exception is raised when there is a problem with a
143+
model field. This can happen for several reasons:
144+
145+
:exc:`FieldError` 例外は、モデルのフィールドに関係した問題がある場合に
146+
送出されます。いくつかの理由が考えられるます:
147+
148+
.. - A field in a model clashes with a field of the same name from an
149+
abstract base class
150+
- An infinite loop is caused by ordering
151+
- A keyword cannot be parsed from the filter parameters
152+
- A field cannot be determined from a keyword in the query
153+
parameters
154+
- A join is not permitted on the specified field
155+
- A field name is invalid
156+
- A query contains invalid order_by arguments
157+
158+
- モデルのフィールドが抽象ベースクラスの同名のフィールドと衝突している
159+
- 並べ替え処理により無限ループが発生した
160+
- フィルターパラメータ中のキーワードが解釈できない
161+
- クエリーパラメータ中のキーワードからフィールドを特定できない
162+
- 指定されたフィールドでの結合 (join) は許可されていない
163+
- フィールド名が不正
164+
- クエリーが不正な order_by 引数を含んでいる
97165

98166
ValidationError
99167
---------------
100168
.. exception:: ValidationError
101169

102-
The :exc:`ValidationError` exception is raised when data fails form or
103-
model field validation. For more information about validation, see
104-
:doc:`Form and Field Validation </ref/forms/validation>`,
105-
:ref:`Model Field Validation <validating-objects>` and the
106-
:doc:`Validator Reference </ref/validators>`.
170+
.. The :exc:`ValidationError` exception is raised when data fails form or
171+
model field validation. For more information about validation, see
172+
:doc:`Form and Field Validation </ref/forms/validation>`,
173+
:ref:`Model Field Validation <validating-objects>` and the
174+
:doc:`Validator Reference </ref/validators>`.
175+
176+
:exc:`ValidationError` 例外は、フォームやモデルフィールドの検証 (validation)
177+
に失敗した場合に送出されます。検証についての詳細は
178+
:doc:`フォームやフィールドの検証 </ref/forms/validation>` 、
179+
:ref:`モデルフィールドの検証 <validating-objects>` 、そして
180+
:doc:`バリデータのリファレンス </ref/validators>` を参照してください。
107181

108182
.. currentmodule:: django.core.urlresolvers
109183

110184
NoReverseMatch
111185
--------------
112186
.. exception:: NoReverseMatch
113187

114-
The :exc:`NoReverseMatch` exception is raised by
115-
:mod:`django.core.urlresolvers` when a matching URL in your URLconf
116-
cannot be identified based on the parameters supplied.
188+
.. The :exc:`NoReverseMatch` exception is raised by
189+
:mod:`django.core.urlresolvers` when a matching URL in your URLconf
190+
cannot be identified based on the parameters supplied.
191+
192+
:exc:`NoReverseMatch` 例外は、指定パラメータに適合する URL を URLconf
193+
から特定できなかった場合に :mod:`django.core.urlresolvers`
194+
によって送出されます。
117195

118196
.. currentmodule:: django.db
119197

120-
Database Exceptions
121-
===================
198+
.. Database Exceptions
199+
===================
200+
201+
データベースの例外
202+
==================
122203

123-
Django wraps the standard database exceptions :exc:`DatabaseError` and
124-
:exc:`IntegrityError` so that your Django code has a guaranteed common
125-
implementation of these classes. These database exceptions are
126-
provided in :mod:`django.db`.
204+
.. Django wraps the standard database exceptions :exc:`DatabaseError` and
205+
:exc:`IntegrityError` so that your Django code has a guaranteed common
206+
implementation of these classes. These database exceptions are
207+
provided in :mod:`django.db`.
208+
209+
Django は標準 (訳注: :pep:`249`) のデータベース例外である :exc:`DatabaseError` と
210+
:exc:`IntegrityError` をラッピングするため、ユーザは Django 用のコードにて
211+
これらのクラスの共通の実装を利用できます。これらのデータベース例外は
212+
:mod:`django.db` の中で定義されています。
213+
(訳注: Django は標準 PEP 249 に従って例外クラスを定義しており、どのデータベース
214+
バックエンドを利用する場合でもこれらを使用します。なおこれらの例外は、
215+
送出のきっかけになった「データベースバックエンドが送出した例外オブジェクト」を
216+
ラッピングする、つまり属性を引き継ぎます。)
127217

128218
.. exception:: DatabaseError
129219
.. exception:: IntegrityError
130220

131-
The Django wrappers for database exceptions behave exactly the same as
132-
the underlying database exceptions. See :pep:`249`, the Python Database API
133-
Specification v2.0, for further information.
221+
.. The Django wrappers for database exceptions behave exactly the same as
222+
the underlying database exceptions. See :pep:`249`, the Python Database API
223+
Specification v2.0, for further information.
224+
225+
Django のデータベース例外用のラッパーは、元になったデータベース例外と完全に
226+
同じ振る舞いをします。さらなる情報については Python データベース API 仕様 v2.0
227+
(:pep:`249`) を参照してください。
134228

135229
.. currentmodule:: django.db.transaction
136230

137-
Transaction Exceptions
138-
======================
231+
.. Transaction Exceptions
232+
======================
233+
234+
トランザクション例外
235+
====================
139236

140237
.. exception:: TransactionManagementError
141238

142-
The :exc:`TransactionManagementError` is raised for any and all problems
143-
related to database transactions. It is available from
144-
:mod:`django.db.transaction`.
239+
.. The :exc:`TransactionManagementError` is raised for any and all problems
240+
related to database transactions. It is available from
241+
:mod:`django.db.transaction`.
145242

146-
Python Exceptions
147-
=================
243+
:exc:`TransactionManagementError` は、データベーストランザクションに関係した
244+
あらゆる問題に対して送出されます。このクラスは
245+
:mod:`django.db.transaction` の中で定義されています。
246+
247+
.. Python Exceptions
248+
=================
249+
250+
Python の例外
251+
=============
252+
253+
.. Django raises built-in Python exceptions when appropriate as well. See the
254+
Python documentation for further information on the
255+
built-in :mod:`exceptions`.
148256

149-
Django raises built-in Python exceptions when appropriate as well. See the
150-
Python documentation for further information on the
151-
built-in :mod:`exceptions`.
257+
Django は、 Python 標準の例外を送出した方が適切な場面においては、そうします。
258+
さらなる情報については Python のドキュメントで標準 :mod:`exceptions`
259+
を参照してください。

0 commit comments

Comments
 (0)