per page, with , order by , clip by
Results of 1 - 10 of about 20 for ContentType (0.020 sec.)
contenttypes フレームワーク 15804
contenttypes フレームワーク Django には contenttypes アプリケーションが含まれており、 Django を使ったプロジェクトにインストールされているすべてのモデルを追跡し、モデルを扱うための高レベルで汎用的なインターフェースを提供します。 概要 contenttype ... types アプリケーションの中心にあるのは、 django.contrib.contenttypes.models.ContentType にある ContentType モデルです。 ContentType のインスタンスは、プロジェクトにインストールされたモデルに ... 関する情報を表し、格納します。新しい ContentType のインスタンスは、新しいモデルがインストールされるたびに自動的に作成されます。 ContentType のインスタンスは ContentType が ... 表すモデルクラスを返すメソッドと、それらのモデルからオブジェクトを問い合わせるメソッドを持っています。また、 ContentType を操作するためのメソッドや、特定のモデルの ContentType のインスタンスを取得するためのメソッドを追加する カスタムマネージャ ...
https://man.mtool.work/django/6.1/ref/contrib/contenttypes.html
Django 1.10.1 リリースノート 8853
Django 1.10.1 リリースノート September 1, 2016 Django 1.10.1 fixes several bugs in 1.10. バグ修正 Fixed a crash in MySQL connections where SELECT @@SQL_AUTO_IS_NULL doesn't return a result ( #26991 ). Allowed User.is_authenticated and User. ... e alias to the InconsistentMigrationHistory message raised by makemigrations and migrate ( #27089 ). Fixed the creation of ContentType and Permission objects for models of applications without migrations when calling the migrate command with no migrations t ... ded the already applied migration state changes in the Apps instance provided to the pre_migrate signal receivers to allow ContentType renaming to be performed on model rename ( #27100 ). Reallowed subclassing UserCreationForm without USERNAME_FIELD in Meta ...
https://man.mtool.work/django/6.1/releases/1.10.1.html
Djangoの認証システムを使用する 8445
Djangoの認証システムを使用する このドキュメントでは、デフォルト設定でのDjangoの認証システムの使用方法を説明します。この設定は、タスクの適切な範囲を管理することで、最も一般的なプロジェクトのニーズにかなうよう徐々に発展してきました。そして、パ ... ように作成できます。 from myapp.models import BlogPost from django.contrib.auth.models import Permission from django.contrib.contenttypes.models import ContentType content_type = ContentType . objects . get_for_model ( BlogPost ) permission = Permission . obj ... できます。 プロキシモデルには独自のコンテンツタイプが必要です プロキシモデルのパーミッション を作成したい場合は、次のように ContentTypeManager.get_for_model() に for_concrete_model=False を渡して、適切な ContentType を取得してください。 content_type = Conten ... m再取得することです。実装例を以下に示します。 from django.contrib.auth.models import Permission , User from django.contrib.contenttypes.models import ContentType from django.shortcuts import get_object_or_404 from myapp.models import BlogPost def user_gains ...
https://man.mtool.work/django/6.1/topics/auth/default.html
複数のデータベース 8445
複数のデータベース ここでは、Djangoがサポートする複数データベースの扱いについて説明します。残りのDjangoのドキュメントの大部分は、あなたが一つのデータベース扱うことを前提としています。複数のデータベースを使いたいなら、いくつかの追加ステップを ... ds.mysql" , "USER" : "mysql_user" , "PASSWORD" : "bacon" , }, } 次に、ルーティングを処理する必要があります。まず、 auth と contenttypes アプリのクエリを auth_db に送信するルーターが必要です ( auth モデルは ContentType にリンクされているので、同じデータベース ... 格納されている必要があります): class AuthRouter : """ A router to control all database operations on models in the auth and contenttypes applications. """ route_app_labels = { "auth" , "contenttypes" } def db_for_read ( self , model , ** hints ): """ Attempt ... s to read auth and contenttypes models go to auth_db. """ if model . _meta . app_label in self . route_app_labels : return "auth_db" return None def db_f ...
https://man.mtool.work/django/6.1/topics/db/multi-db.html
Django オブジェクトのシリアライズ 8326
Django オブジェクトのシリアライズ Django のシリアライズフレームワークは、Django のモデルを他のフォーマットに「翻訳」する仕組みを提供します。通常、このような他のフォーマットはテキストベースや Django データをネットワーク越しに送信するために使 ... 他のリレーション先フィールドは、少し違う扱いになります: <object pk= "27" model= "auth.permission" > <!-- ... --> <field to= "contenttypes.contenttype" name= "content_type" rel= "ManyToOneRel" > 9 </field> <!-- ... --> </object> この例では、PK 27の auth.Permis ... sion オブジェクトが、PK 9の contenttypes.ContentType インスタンスに対する外部キーを持つように指定しています。 多対多のリレーションはそれらを結びつけるモデルに対し ... ライズするというものです。この戦略はほとんどのオブジェクトに対してうまく機能しますが、いくつかの状況で困難を引き起こします。 ContentType を参照する外部キーを持つオブジェクトのリストの場合を考えてみてください。もしcontent type を参照するオブジェクトをシリアライ ...
https://man.mtool.work/django/6.1/topics/serialization.html
管理アクション 8258
管理アクション Djangoの管理者の基本的な仕事は、一言で言えば、「オブジェクトを選択し、それを変更する」ことに尽きます。これは大多数のユースケースに当てはまります。しかし、一度に多くのオブジェクトに同じ変更を適用する必要がある場合、この仕事は退 ... たいでしょう。最良の方法は、カスタムエクスポートビューにリダイレクトする小さなアクションを書くことです: from django.contrib.contenttypes.models import ContentType from django.http import HttpResponseRedirect def export_selected_objects ( modeladmin , request ... , queryset ): selected = queryset . values_list ( "pk" , flat = True ) ct = ContentType . objects . get_for_model ( queryset . model ) return HttpResponseRedirect ( "/export/?ct= %s &ids= %s " % ( ct . pk , "," ... はとても短いです。複雑なロジックはすべてエクスポートビューにあります。これは任意のタイプのオブジェクトを扱う必要があるため、 ContentType に関する処理が必要になります。 このビューの作成は、読者にとっての演習課題として残されています。 アクションをサイト全体で利 ...
https://man.mtool.work/django/6.1/ref/contrib/admin/actions.html
Django 3.0.3 リリースノート 8258
Django 3.0.3 リリースノート 2020年2月3日 Django 3.0.3 では、セキュリティの問題1件と 3.0.2 におけるいくつかのバグを修正しました。 CVE-2020-7471: StringAgg(delimiter) を通じた潜在的 SQL インジェクション StringAgg 集計関数には、適切に加工された ... ーライドしたときに get_FOO_display() が正しく動かなくなる Django 2.2.7 のリグレッションを修正しました ( #31124 )。 カスタム ContentType 外部キーを持つ GenericForeignKey に対する``QuerySet.prefetch_related()`` がクラッシュする Django 3.0 のリグレッションを修正 ...
https://man.mtool.work/django/6.1/releases/3.0.3.html
索引 8207
索引 記号 | _ | 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 コマン ... プション inspectdb コマンドラインオプション loaddata コマンドラインオプション migrate コマンドラインオプション remove_stale_contenttypes コマンドラインオプション showmigrations コマンドラインオプション sqlflush コマンドラインオプション sqlmigrate コマンドライ ... oaddata コマンドラインオプション --include-partitions inspectdb コマンドラインオプション --include-stale-apps remove_stale_contenttypes コマンドラインオプション --include-views inspectdb コマンドラインオプション --indent dumpdata コマンドラインオプション -- ... ase のメソッド) app_directories.Loader (django.template.loaders のクラス) app_index_template (AdminSite の属性) app_label (ContentType の属性) (Options の属性) app_name (ResolverMatch の属性) app_names (ResolverMatch の属性) AppCommand (django.core.manageme ...
https://man.mtool.work/django/6.1/genindex.html
カスタム shell コマンドの作り方 8207
カスタム shell コマンドの作り方 Djangoの shell は、モデルと設定へのアクセスを提供する対話型の Python 環境であり、コードのテスト、クエリの実験、アプリケーションデータとのやりとりに役立ちます。 shell コマンドをカスタマイズすることで、機能を追 ... go.contrib.admin.models import LogEntry from django.contrib.auth.models import Group, Permission, User from django.contrib.contenttypes.models import ContentType from django.contrib.sessions.models import Session from django.urls import resolve, reverse fro ...
https://man.mtool.work/django/6.1/howto/custom-shell.html
Django 1.5 リリースノート 8089
Django 1.5 リリースノート February 26, 2013 Django 1.5 へようこそ! These release notes cover the new features , as well as some backwards incompatible changes you'll want to be aware of when upgrading from Django 1.4 or older versions. We'v ... hich collide with Django's syntax, you can now use the verbatim block tag to avoid parsing the tag's content. Retrieval of ContentType instances associated with proxy models The methods ContentTypeManager.get_for_model() and ContentTypeManager.get_for_model ... ively for_concrete_model and for_concrete_models . By passing False using this argument it is now possible to retrieve the ContentType associated with proxy models. New view variable in class-based views context In all generic class-based views (or any clas ... attribute on the form. Behavior of syncdb with multiple databases syncdb now queries the database routers to determine if content types (when contenttypes is enabled) and permissions (when auth is enabled) should be created in the target database. Previous ...
https://man.mtool.work/django/6.1/releases/1.5.html
PREV 1 2 NEXT