per page, with , order by , clip by
Results of 1 - 10 of about 27 for item (0.005 sec.)
配信 (syndication) フィード フレームワーク 15783
配信 (syndication) フィード フレームワーク Django には、 RSS と Atom フィードを作成するための高レベルな配信 (syndication) フィード生成フレームワークが付属しています。 任意の配信フィードを作成するには、短い Python クラスを書くだけで済みます。 ... います: from django.contrib.syndication.views import Feed from django.urls import reverse from policebeat.models import NewsItem class LatestEntriesFeed ( Feed ): title = "Police beat site news" link = "/sitenews/" description = "Updates on changes an ... d additions to police beat central." def items ( self ): return NewsItem . objects . order_by ( "-pub_date" )[: 5 ] def item_title ( self , item ): return item . title ... def item_description ( self , item ): return item . description # item_link is only needed if NewsItem has no get_absolute_url meth ...
https://man.mtool.work/django/6.1/ref/contrib/syndication.html
複合主キー 10269
複合主キー Django では、すべてのモデルに主キーが存在します。デフォルトでは、この主キーは単一のフィールドで構成されます。 ほとんどの場合、単一の主キーで十分です。しかし、データベース設計においては、複数のフィールドからなる主キーが必要になるこ ... 0 ) class Order ( models . Model ): reference = models . CharField ( max_length = 20 , primary_key = True ) class OrderLineItem ( models . Model ): pk = models . CompositePrimaryKey ( "product_id" , "order_id" ) product = models . ForeignKey ( Produc ... > product = Product . objects . create ( name = "apple" ) >>> order = Order . objects . create ( reference = "A755H" ) >>> item = OrderLineItem . objects . create ( product = product , order = order , quantity = 1 ) >>> item . pk (1, "A755H") pk 属性 ... に tuple を代入することで、対応するフィールドの値をまとめて設定できます: >>> item = OrderLineItem ( pk = ( 2 , "B142C" )) >>> item . pk (2, "B142C") >>> item . product_id 2 >>> item . order_id "B142C" 複合 ...
https://man.mtool.work/django/6.1/topics/composite-primary-key.html
地理情報フィード 10138
地理情報フィード GeoDjango には独自の Feed サブクラスがあり、 Simple GeoRSS または W3C Geo 標準に従ってフォーマットされた RSS/Atom フィードに位置情報を埋め込むことができます。GeoDjango の syndication API は Django のスーパーセットなので、 D ... してください: from django.contrib.gis.feeds import Feed class MyFeed ( Feed ): # First, as a class attribute. geometry = ... item_geometry = ... # Also a function with no arguments def geometry ( self ): ... def item_geometry ( self ): ... # And as a f ... unction with a single argument def geometry ( self , obj ): ... def item_geometry ( self , item ): ... geometry ( obj ) get_object() で返されたオブジェクトを受け取り、 feed のジオメトリを返します ... obj ): # Can also return: `obj.poly`, and `obj.poly.centroid`. return obj . poly . extent # tuple like: (X0, Y0, X1, Y1). item_geometry ( item ) これをセットすると、フィードの各 アイテム のジオメトリを返します。これは GEOSGeometry のインスタンス、 あ ...
https://man.mtool.work/django/6.1/ref/contrib/gis/feeds.html
サイトマップ・フレームワーク 9035
サイトマップ・フレームワーク Djangoには、 sitemap XML ファイルを作成するための高レベルなサイトマップ生成フレームワークが付属しています。 概要 サイトマップとは、検索エンジンのインデクサーに、ページの変更頻度や、あるページがサイト内の他のペー ... の作成を自動化します。 これは Django の 配信 (syndication) フレームワーク のように動作します。サイトマップを作成するには、 Sitemap クラスを書き、 URLconf の中でそれを指定します。 インストール サイトマップ アプリをインストールするには、以下の手順に従っ ... てください。 'django.contrib.sitemaps' を INSTALLED_APPS 設定に追加します。 TEMPLATES 設定には、 DjangoTemplates バックエンドが含まれており、 APP_DIRS オプシ ... 必要があるのは、 Loader() テンプレートローダーがデフォルトのテンプレートを見つけられるようにするためです)。 初期設定 views. sitemap ( request , sitemaps , section = None , template_name = 'sitemap.xml' , content_type = 'application/xml' ) Django サイト ...
https://man.mtool.work/django/6.1/ref/contrib/sitemaps.html
Django ユーティリティ (django.utils) 8278
Django ユーティリティ ( django.utils ) このドキュメントは、 django.utils のすべての安定したモジュールを対象としています。 django.utils 内のほとんどのモジュールは内部使用を目的としていることから、 内部リリース非推奨ポリシー に従い、以下に記載 ... = "A group blog by the sharpest minds in online media/journalism/publishing." , ... language = "en" , ... ) >>> feed . add_item ( ... title = "Hello" , ... link = "https://www.holovaty.com/test/" , ... description = "Testing." , ... ) >>> with open ( ... であるべきです。 stylesheets には、文字列または Stylesheet インスタンスのいずれかのシーケンスを指定する必要があります。 add_item ( title , link , description , author_email = None , author_name = None , author_link = None , pubdate = None , comments = ... None , unique_id = None , categories = () , item_copyright = None , ttl = None , updateddate = None , enclosures = None , ** kwargs ) [ソース] フィードにアイテムを追加しま ...
https://man.mtool.work/django/6.1/ref/utils.html
ページ分割 (Pagination) 8031
ページ分割 (Pagination) Django は、ページ分割 (ページネーション) されたデータを管理するための高レベルと低レベルの方法を提供しています。つまり、"前へ/次へ" リンクを持つ、複数のページに分割されたデータです。 Paginator クラス 内部では、ページ分 ... page contains no results >>> page2 . previous_page_number () 1 >>> page2 . start_index () # The 1-based index of the first item on this page 3 >>> page2 . end_index () # The 1-based index of the last item on this page 4 >>> p . page ( 0 ) Traceback ( ...
https://man.mtool.work/django/6.1/topics/pagination.html
Django 1.2 リリースノート 7817
Django 1.2 リリースノート 2010 年 5 月 17 日 Django 1.2 へようこそ! Nearly a year in the making, Django 1.2 packs an impressive list of new features and lots of bug fixes. These release notes cover the new features, as well as important cha ... 2" DATABASE_USER = "myusername" DATABASE_PASSWORD = "s3krit" These settings are now in a dictionary named DATABASES . Each item in the dictionary corresponds to a single database connection, with the name 'default' describing the default database con ... late attributes). You should ensure that you always specify title_template and description_template attributes, or provide item_title() and item_description() methods. However, LatestEntriesByCategory uses the get_object() method with the bits argume ...
https://man.mtool.work/django/6.1/releases/1.2.html
アグリゲーション (集計) 7817
アグリゲーション (集計) Djangoのデータベース抽象API のトピックガイドでは、個別のオブジェクトの作成、取得、削除を行うDjangoのクエリの使い方を説明しました。しかし、オブジェクトのコレクションを 集計 (アグリゲーション) した値や、集計することによ ... これは特に、何かを数えるときに顕著に現れます。 たとえば、次のようなモデルがあるとします: from django.db import models class Item ( models . Model ): name = models . CharField ( max_length = 10 ) data = models . IntegerField () それぞれの data 値が、並 ... べ替えられたクエリセットに何回現れるかを数えたい場合は、次のようにします: items = Item . objects . order_by ( "name" ) # Warning: not quite correct! items . values ( "data" ) . annotate ( Count ( "id" ... )) ...これは Item オブジェクトを共通の data 値でグループ化し、各グループの id 値の数をカウントします。ただし、これはうまくいきません。 name ...
https://man.mtool.work/django/6.1/topics/db/aggregation.html
索引 7735
索引 記号 | _ | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | ア | イ | ク | コ | シ | ス | テ | ハ | ヒ | フ | メ | モ | ロ | 具 | 国 | 環 | 翻 | 表 | 言 | 長 記号 -- dbshell コマン ... ) (backends.base.SessionBase のメソッド) __contains__() (backends.base.SessionBase のメソッド) (QueryDict のメソッド) __delitem__() (backends.base.SessionBase のメソッド) (HttpResponse のメソッド) __eq__() (Model のメソッド) __getattr__() (Area のメソ ... ッド) (Distance のメソッド) __getitem__() (backends.base.SessionBase のメソッド) (HttpResponse のメソッド) (OGRGeometry のメソッド) (QueryDict のメソッド) (Spat ... (HttpRequest のメソッド) (ModelChoiceIterator のメソッド) (OGRGeometry のメソッド) __len__() (OGRGeometry のメソッド) __setitem__() (backends.base.SessionBase のメソッド) (HttpResponse のメソッド) (QueryDict のメソッド) __str__() (Model のメソッド) ( ...
https://man.mtool.work/django/6.1/genindex.html
組み込みテンプレートタグとフィルタ 7735
組み込みテンプレートタグとフィルタ このドキュメントでは、 Django の組み込みテンプレートタグとフィルタについて述べます。 また 自動ドキュメンテーション を使えばインストールされている組み込みタグとカスタムタグのドキュメントを読めるのでお勧めで ... い場合にも便利です。例えば data という辞書がある場合、以下のように辞書内のキーと値を表示できます: {% for key , value in data.items %} {{ key }} : {{ value }} {% endfor %} ドット演算子を使う場合、メソッドよりも辞書キーへの参照が優先することに注意してくだ ... さい。したがって、もしも data 辞書が 'items' という名前のキーを持っていたなら、 data.items は data.items() ではなく data['items'] の値を出力します。テンプレート内で辞 ... 書のメソッドを使いたい場合、そのような名前のキー ( items 、 values 、 keys など) を辞書に追加しないでください。ドット演算子による参照の優先順位についての詳細は テンプレート変数の ...
https://man.mtool.work/django/6.1/ref/templates/builtins.html
PREV 1 2 3 NEXT