Skip to content

Commit f30db88

Browse files
committed
cleaned TBDs away from syndication.txt.
1 parent 0494dcd commit f30db88

File tree

2 files changed

+39
-38
lines changed

2 files changed

+39
-38
lines changed

ref/contrib/syndication.txt

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -977,49 +977,50 @@ Feed クラスリファレンス
977977
カスタムのフィードジェネレータ
978978
---------------------------------
979979

980-
.. TBD
981-
982-
If you need to produce a custom feed format, you've got a couple of options.
983-
984-
If the feed format is totally custom, you'll want to subclass
985-
``SyndicationFeed`` and completely replace the ``write()`` and
986-
``writeString()`` methods.
987-
988-
However, if the feed format is a spin-off of RSS or Atom (i.e. GeoRSS_, Apple's
989-
`iTunes podcast format`_, etc.), you've got a better choice. These types of
990-
feeds typically add extra elements and/or attributes to the underlying format,
991-
and there are a set of methods that ``SyndicationFeed`` calls to get these extra
992-
attributes. Thus, you can subclass the appropriate feed generator class
993-
(``Atom1Feed`` or ``Rss201rev2Feed``) and extend these callbacks. They are:
980+
カスタムのフォーマットでフィードを生成したいなら、二つ方法があります。
981+
982+
完全に独自の形式のフィードなら、 ``SyndicationFeed`` をサブクラス化して、
983+
``write()`` および ``writeString()`` メソッドを完全に書き直すとよいでしょう。
984+
985+
しかし、 (GeoRSS_ や Apple の
986+
`iTunes podcast フォーマット <iTunes podcast format>`_ )のように、既存のフィー
987+
ドフォーマットから派生したものであれば、もっといい選択肢があります。この手
988+
の派生フォーマットは、元のフォーマットにエレメントや属性を追加していて、
989+
``SyndicationFeed`` のメソッドには、こうした追加の属性を取得するためのもの
990+
があります。ですから、適切なフィードクラス (``Atom1Feed`` や
991+
``Rss201rev2Feed``) をサブクラス化して、コールバックを拡張すればよいのです。
992+
拡張用のメソッドを以下に示します:
994993

995994
.. _georss: http://georss.org/
996995
.. _itunes podcast format: http://www.apple.com/itunes/store/podcaststechspecs.html
997996

998997
``SyndicationFeed.root_attributes(self, )``
999-
Return a ``dict`` of attributes to add to the root feed element
1000-
(``feed``/``channel``).
998+
フィードのルート要素 (``feed``/``channel``) に追加する属性の入った
999+
``dict`` を返します。
10011000

10021001
``SyndicationFeed.add_root_elements(self, handler)``
1003-
Callback to add elements inside the root feed element
1004-
(``feed``/``channel``). ``handler`` is an `XMLGenerator`_ from Python's
1005-
built-in SAX library; you'll call methods on it to add to the XML
1006-
document in process.
1002+
フィードのルート要素 (``feed``/``channel``) 要素に新たに要素を付加する
1003+
ためのコールバックです。 ``handler`` は Python 組み込み SAX ライブラリ
1004+
の XMLGenerator_ です。このオブジェクトのメソッドを呼び出して、 処理中
1005+
の XML ドキュメントに要素を追加します。
10071006

10081007
``SyndicationFeed.item_attributes(self, item)``
1009-
Return a ``dict`` of attributes to add to each item (``item``/``entry``)
1010-
element. The argument, ``item``, is a dictionary of all the data passed to
1011-
``SyndicationFeed.add_item()``.
1008+
フィードの各要素 (``item``/``entry``) に追加する属性の入った ``dict``
1009+
を返します。引数 ``item`` は、 ``SyndicationFeed.item()`` に渡された
1010+
データの入っている ``dict`` です。
10121011

10131012
``SyndicationFeed.add_item_elements(self, handler, item)``
1014-
Callback to add elements to each item (``item``/``entry``) element.
1015-
``handler`` and ``item`` are as above.
1013+
各要素の (``item``/``entry``) 要素に新たに要素を付加するためのコールバッ
1014+
クです。 ``handler`` ``item`` は上と同じです。
10161015

10171016
.. warning::
10181017

1019-
If you override any of these methods, be sure to call the superclass methods
1020-
since they add the required elements for each feed format.
1018+
これらのメソッドをオーバライドするときは、スーパクラスのメソッドを忘れ
1019+
ずに呼び出してください。スーパクラス側でも、必須の要素を追加するために
1020+
これらのメソッドを使っているからです。
10211021

1022-
For example, you might start implementing an iTunes RSS feed generator like so::
1022+
例えば、 iTunes RSS フィードジェネレータを実装するなら、書き始めは以下のよ
1023+
うになるでしょう::
10231024

10241025
class iTunesFeed(Rss201rev2Feed):
10251026
def root_attibutes(self):
@@ -1031,7 +1032,7 @@ For example, you might start implementing an iTunes RSS feed generator like so::
10311032
super(iTunesFeed, self).add_root_elements(handler)
10321033
handler.addQuickElement('itunes:explicit', 'clean')
10331034

1034-
Obviously there's a lot more work to be done for a complete custom feed class,
1035-
but the above example should demonstrate the basic idea.
1035+
もちろん、カスタムのフィードクラスを定義するには他にもたくさん作業が必要で
1036+
すが、上の例を見れば基本的な考え方は理解できるはずです。
10361037

10371038
.. _XMLGenerator: http://docs.python.org/dev/library/xml.sax.utils.html#xml.sax.saxutils.XMLGenerator

topics/db/managers.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -187,15 +187,13 @@
187187
なくなるような羽目に陥らないように、デフォルトマネジャの選択には細心の注意
188188
を払ってください。
189189

190-
.. TBD
191-
192-
Using managers for related object access
193-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
190+
マネジャを使ってリレーション先のオブジェクトにアクセスする
191+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
194192

195-
By default, Django uses a "bare" (i.e. default) manager when accessing related
196-
objects (i.e. ``choice.poll``). If this default isn't appropriate for your
197-
default manager, you can force Django to use a custom manager for related object
198-
attributes by giving it a ``use_for_related_fields`` property::
193+
デフォルトでは、 Django は「素の」マネジャを使って (``choice.poll`` のよう
194+
な)リレーション先のオブジェクトにアクセスします。リレーションを扱うときに
195+
別のマネジャを使いたいのなら、 ``use_for_related_fields`` プロパティの設定
196+
されたカスタムマネジャを定義してください::
199197

200198
class MyManager(models.Manager)::
201199
use_for_related_fields = True
@@ -204,6 +202,8 @@ attributes by giving it a ``use_for_related_fields`` property::
204202

205203
...
206204

205+
.. TBD
206+
207207
Custom managers and model inheritance
208208
-------------------------------------
209209

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy