per page, with , order by , clip by
Results of 1 - 10 of about 191 for models (0.011 sec.)
索引 10059
索引 記号 | _ | 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 コマン ... _state (Model の属性) A A (django.contrib.gis.measure のクラス) aadd() (RelatedManager のメソッド) aaggregate() (django.db.models.query.QuerySet モジュール) aauthenticate() (django.contrib.auth モジュール) (ModelBackend のメソッド) (RemoteUserBackend の ... メソッド) Abs (django.db.models.functions のクラス) ABSOLUTE_URL_OVERRIDES setting abstract (Options の属性) abulk_create() (django.db.models.query.QueryS ... et モジュール) abulk_update() (django.db.models.query.QuerySet モジュール) accept_idna (DomainNameValidator の属性) accepts() (HttpRequest のメソッド) AccessMixin (django ...
https://man.mtool.work/django/6.1/genindex.html
モデル 9035
モデル モデルは、データに関する唯一かつ決定的な情報源です。あなたが保持するデータが必要とするフィールドとその動作を定義します。一般的に、各モデルは単一のデータベースのテーブルに対応付けられます。 基本: モデルは各々 Python のクラスであり dja ... ngo.db.models.Model のサブクラスです。 モデルの属性はそれぞれがデータベースのフィールドを表します。 これら全てを用いて、Django はデータベ ... てください。 簡単な例 次の例では first_name と last_name を持つ Person というモデルを定義しています。 from django.db import models class Person ( models . Model ): first_name = models . CharField ( max_length = 30 ) last_name = models . CharField ( max_ ... デルを 利用する ということを知らせる必要があります。そのためには、設定ファイルを編集して、設定値 INSTALLED_APPS に、定義した models.py を含むモジュール名を追加します。 たとえば、アプリケーションのモデルが myapp.models モジュール内に存在する場合 (このパッ ...
https://man.mtool.work/django/6.1/topics/db/models.html
データベース関数 8784
データベース関数 The classes documented below provide a way for users to use functions provided by the underlying database as annotations, aggregations, or filters in Django. Functions are also expressions , so they can be used and combined ... nctions . See the Func documentation for security considerations. 各関数の例では、以下のモデルを使用します: class Author ( models . Model ): name = models . CharField ( max_length = 50 ) age = models . PositiveIntegerField ( null = True , blank = True ... ) alias = models . CharField ( max_length = 50 , null = True , blank = True ) goes_by = models . CharField ( max_length = 50 , null = True ... on , output_field ) [ソース] 式 expression の結果の型を output_field の型に強制的に変更します。 使用例: >>> from django.db.models import FloatField >>> from django.db.models.functions import Cast >>> Author . objects . create ( age = 25 , name = "Marga ...
https://man.mtool.work/django/6.1/ref/models/database-functions.html
モデル _meta API 8751
モデル _meta API class Options [ソース] モデルの _meta API は、Django ORM のコアにあります。これにより、ルックアップ、クエリ、フォーム、admin などのシステムの他のパーツは、各モデルの機能を理解できるようになります。API は、各モデルクラスの _ ... meta 属性からアクセス可能で、 django.db.models.options.Options オブジェクトのインスタンスとなっています。 提供されるメソッドと属性は次のことに利用できます。 モデルのすべ ... me. 与えられた名前のフィールドが見つからなかったときは、 FieldDoesNotExist 例外が発生します。 >>> from django.contrib.auth.models import User # A field on the model >>> User . _meta . get_field ( "username" ) <django.db.models.fields.CharField: usernam ... hidden False by default. If set to True , get_fields() will include fields with hidden=True . >>> from django.contrib.auth.models import User >>> User . _meta . get_fields () (<ManyToOneRel: admin.logentry>, <django.db.models.fields.AutoField: id>, <dj ...
https://man.mtool.work/django/6.1/ref/models/meta.html
モデルフィールドリファレンス 8468
モデルフィールドリファレンス このドキュメントには、Django が提供するフィールドオプション field options とフィールド型 field types を含む、 Field のすべての API リファレンスが記載されています。 注釈 フィールドは django.db.models.fields に定義 ... されていますが、利便性のために django.db.models にインポートされています。標準的な慣例としては、 from django.db import models を使用し、フィールドを models.<Foo>Field とし ... として定義することもできます。例えば def get_currencies (): return { i : i for i in settings . CURRENCIES } class Expense ( models . Model ): amount = models . DecimalField ( max_digits = 10 , decimal_places = 2 ) currency = models . CharField ( max_len ... 、モデルクラスの内部で選択肢を定義し、それぞれの値に適切に名前づけられた定数を定義するのがベストです: from django.db import models class Student ( models . Model ): FRESHMAN = "FR" SOPHOMORE = "SO" JUNIOR = "JR" SENIOR = "SR" GRADUATE = "GR" YEAR_IN_SCH ...
https://man.mtool.work/django/6.1/ref/models/fields.html
Fetch modes 8239
Fetch modes New in Django 6.1. When accessing model fields that were not loaded as part of the original query, Django will fetch that field's data from the database. You can customize the behavior of this fetching with a fetch mode , making ... king it. Use QuerySet.fetch_mode() to set the fetch mode for model instances fetched by a QuerySet : from django.db import models books = Book . objects . fetch_mode ( models . FETCH_PEERS ) Fetch modes apply to: ForeignKey fields OneToOneField fields ... ch modes don't affect such managers' queries. Available modes Referencing fetch modes Fetch modes are defined in django.db.models.fetch_modes , but for convenience they're imported into django.db.models . The standard convention is to use from django.d ... b import models and refer to the fetch modes as models.<mode> . Django provides three fetch modes. We'll explain them below using these mo ...
https://man.mtool.work/django/6.1/topics/db/fetch-modes.html
マネージャ 8185
マネージャ class Manager [ソース] マネージャ (Manager) とは、Django のモデルに対するデータベースクエリの操作を提供するインターフェイスです。Django アプリケーション内の1つのモデルに対して、 Manager は最低でも1つは存在します。 Manager クラスの ... 使いたい場合には、各モデル単位で好きな名前を付けることができます。あるクラスの Manager の名前を変えるには、そのクラスの上で models.Manager() と書いて、クラス変数を定義します。たとえば、次のように書きます。 from django.db import models class Person ( mod ... els . Model ): # ... people = models . Manager () このモデル例を使うと、 Person.objects は AttributeError 例外を起こしますが、 Person.people.all() と書けば、す ... デルメソッド を使ってください。 たとえば、このカスタム Manager は with_counts() メソッドを追加します: from django.db import models from django.db.models.functions import Coalesce class PollManager ( models . Manager ): def with_counts ( self ): return s ...
https://man.mtool.work/django/6.1/topics/db/managers.html
Django 1.7 リリースノート 7923
Django 1.7 リリースノート September 2, 2014 Django 1.7 へようこそ! このリリースノートでは、 バージョン 1.7 の新機能 と、Django 1.6 以前からアップグレードする際に注意すべき、 後方互換性のない変更 について説明します。 非推奨サイクルが終了した ... ease of Django 1.8. Django 1.7 の新機能 Schema migrations Django now has built-in support for schema migrations. It allows models to be updated, changed, and deleted by creating migration files that represent the model changes and which can be run on a ... calls to syncdb will still work as before. A new makemigrations command provides an easy way to autodetect changes to your models and make migrations for them. django.db.models.signals.pre_syncdb and django.db.models.signals.post_syncdb have been depre ... or ManyToManyField to) apps with migrations. App-loading refactor Historically, Django applications were tightly linked to models. A singleton known as the "app cache" dealt with both installed applications and models. The models module was used as an ...
https://man.mtool.work/django/6.1/releases/1.7.html
Django の admin サイト 7901
Django の admin サイト Django のパワフルな特徴の1つは、自動的に生成される admin インタフェースです。あなたのモデルクラスからメタデータを読み取り、モデル中心のインタフェースを提供します。このインタフェースのおかげで、ユーザはあなたのサイトの ... アプリケーション内の admin.py に記述されます。 ModelAdmin の例を見てみましょう: from django.contrib import admin from myapp.models import Author class AuthorAdmin ( admin . ModelAdmin ): pass admin . site . register ( Author , AuthorAdmin ) いつでも Mod ... の記述をせずにモデルクラスを登録できます。上記の例は、次のように簡略化できます。 from django.contrib import admin from myapp.models import Author admin . site . register ( Author ) register デコレータ register ( * models , site = django.contrib.admin.sit ... es.site ) [ソース] ModelAdmin を登録するために、デレコータも用意されています: from django.contrib import admin from .models import Author @admin . register ( Author ) class AuthorAdmin ( admin . ModelAdmin ): pass 1 つ以上のモデルが与えられ、 Mod ...
https://man.mtool.work/django/6.1/ref/contrib/admin/
Porting your apps from Django 0.96 to 1.0 7814
Porting your apps from Django 0.96 to 1.0 Django 1.0 breaks compatibility with 0.96 in some areas. This guide will help you port 0.96 projects and apps to 1.0. The first part of this document includes the common changes needed to run with 1 ... se Unicode literals will prevent some obscure problems. See Unicode データ for full details. モデル Common changes to your models file: Rename maxlength to max_length Rename your maxlength argument to max_length (this was changed to be consistent with ... emove all references to core . Replace class Admin: with admin.py Remove all your inner class Admin declarations from your models. They won't break anything if you leave them, but they also won't do anything. To register apps with the admin you'll move ... py file; see the admin below for more details. 参考 A contributor to djangosnippets has written a script that'll scan your models.py and generate a corresponding admin.py . カスタマイズ例 Below is an example models.py file with all the changes you'll n ...
https://man.mtool.work/django/6.1/releases/1.0-porting-guide.html
PREV 1 2 3 4 5 6 7 8 9 10 NEXT