per page, with , order by , clip by
Results of 1 - 9 of about 9 for event (0.005 sec.)
PostgreSQL 固有のモデルフィールド 12384
PostgreSQL 固有のモデルフィールド これらのフィールドは全て django.contrib.postgres.fields モジュールから利用できます。 これらのフィールドにインデックスを付ける Index と Field.db_index は両方とも B-tree インデックスを作成しますが、複雑なデー ... 、次の例のモデルを使います: from django.contrib.postgres.fields import IntegerRangeField from django.db import models class Event ( models . Model ): name = models . CharField ( max_length = 200 ) ages = IntegerRangeField () start = models . DateTimeFi ... 以下のオブジェクト例も使用します: >>> import datetime >>> from django.utils import timezone >>> now = timezone . now () >>> Event . objects . create ( name = "Soft play" , ages = ( 0 , 10 ), start = now ) >>> Event . objects . create ( ... name = "Pub ... の包含演算子があります。 contains , contained_by , overlap で、それぞれ SQL 演算子 @> , <@ , && が使われます。 contains >>> Event . objects . filter ( ages__contains = NumericRange ( 4 , 5 )) <QuerySet [<Event: Soft play>]> contained_by >>> Event . obj ...
https://man.mtool.work/django/6.1/ref/contrib/postgres/fields.html
admin アプリケーションの JavaScript カスタマイズ 12276
admin アプリケーションの JavaScript カスタマイズ インラインフォームイベント インラインフォームが admin アプリケーション変更フォームに追加または削除された際に JavaScript を実行したい場合、 formset:added と formset:removed イベントを使用できま ... す。 event.detail.formsetName は行が属するフォームセットを示します。 formset:added イベントでは、 event.target は新しく追加された行で ... = " {% static 'app/formset_handlers.js' %} " ></ script > {% endblock %} app/static/app/formset_handlers.js document . addEventListener ( 'formset:added' , ( event ) => { if ( event . detail . formsetName == 'author_set' ) { // Do something } }); doc ... ument . addEventListener ( 'formset:removed' , ( event ) => { // Row removed }); 注意点が2つあります: もし admin/change_form.html を継承して ...
https://man.mtool.work/django/6.1/ref/contrib/admin/javascript.html
非同期サポート 8376
非同期サポート Django has support for writing asynchronous ("async") views, along with an entirely async-enabled request stack if you are running under ASGI . Async views will still work under WSGI, but with a small per-request adaptation c ... to run. The per-call cost of this adaptation is small: tens of microseconds in the in-request ASGI path, where the running event loop is reused, and a few hundred microseconds in the cold-start path used by management commands, background tasks, and s ... t when you are using ASGI for high in-process concurrency over non-ORM I/O (for example upstream HTTP fan-out, server-sent events, or other long-lived requests), where the extra thread per request caps that concurrency. 自分のコード上での ASGI と WSGI ... also enables the thread_sensitive mode of sync_to_async() when that wrapper is used below it. In the cold path (no running event loop) it pays the cost of starting a fresh event loop, like asyncio.run() ; when an event loop is already running (the in- ...
https://man.mtool.work/django/6.1/topics/async.html
Django 1.7.1 リリースノート 8088
Django 1.7.1 リリースノート October 22, 2014 Django 1.7.1 fixes several bugs in 1.7. バグ修正 Allowed related many-to-many fields to be referenced in the admin ( #23604 ). Added a more helpful error message if you try to migrate an app with ... have been fixed (trailing dot removed, #23532 ). Added quoting of constraint names in the SQL generated by migrations to prevent crash with uppercase characters in the name ( #23065 ). Fixed renaming of models with a self-referential many-to-many fiel ... th cursor.execute() ( #23426 ). TEST 辞書の SERIALIZE 項目を使用可能にしました ( #23421 )。 Fixed bug in migrations that prevented foreign key constraints to unmanaged models with a custom primary key ( #23415 ). Added SchemaEditor for MySQL GIS backe ... e-aware values ( #23365 ). Added a prompt to the migrations questioner when removing the null constraint from a field to prevent an IntegrityError on existing NULL rows ( #23609 ). Fixed generic relations in ModelAdmin.list_filter ( #23616 ). Restored ...
https://man.mtool.work/django/6.1/releases/1.7.1.html
コンテンツセキュリティポリシー 7998
コンテンツセキュリティポリシー New in Django 6.0. Content Security Policy (CSP) is a web security standard that helps prevent content injection attacks by restricting the sources from which content can be loaded. It plays an important role ... of eval() and similar JavaScript functions. Strongly discouraged. UNSAFE_HASHES Represents 'unsafe-hashes' . Allows inline event handlers and some javascript: URIs when their content hashes match a policy rule. Requires CSP Level 3+. UNSAFE_INLINE Rep ...
https://man.mtool.work/django/6.1/ref/csp.html
QuerySet API リファレンス 7998
QuerySet API リファレンス このドキュメントでは、 QuerySet API の詳細を説明しています。 モデル と データベースクエリ ガイドにある説明を前提としていますので、このドキュメントを読む前にこの 2 つを読んでおくことをおすすめします。 このリファレン ... れています(たとえば、 ManyToManyField フィールド、もしくは ForeignKey フィールドの逆参照など)。 このケースを考えます: class Event ( Model ): parent = models . ForeignKey ( "self" , on_delete = models . CASCADE , related_name = "children" , ) date = mod ... els . DateField () Event . objects . order_by ( "children__date" ) ここで、それぞれの Event に対して、複数の並べ替えデータが存在する可能性があります ... ; 複数の children を伴う Event は、 order_by() が作る新たな QuerySet においてそれぞれ複数回返されることになります。言い換えれば、 QuerySet で order_by() ...
https://man.mtool.work/django/6.1/ref/models/querysets.html
全文検索 7891
全文検索 django.contrib.postgres.search モジュールのデータベース関数は PostgreSQL の 全文検索エンジン を利用しやすくしています。 このドキュメントの例では、 クエリを作成する で定義されたモデルを使用します。 参考 検索の概要については、 トピッ ... フォーマンスの問題に直面する可能性が高くなります。全文検索は、例えば整数のサイズを比較するよりも負荷の高い処理です。 In the event that all the fields you're querying on are contained within one particular model, you can create a functional GinIndex or ...
https://man.mtool.work/django/6.1/ref/contrib/postgres/search.html
ロギング 7891
ロギング 参考 ロギングの設定と利用 Django のロギングの概要 Django の logging モジュールは Python の 組み込み logging モジュールを継承しています。 Logging は、一般的なDjangoの django.setup() 関数の一部として設定されているため、明示的に無効に ... rrors. There is a sub-logger for each subtype of security error, including all SuspiciousOperation s. The level of the log event depends on where the exception is handled. Most occurrences are logged as a warning, while any SuspiciousOperation that re ...
https://man.mtool.work/django/6.1/ref/logging.html
Django 3.0 リリースノート 7891
Django 3.0 リリースノート 2019年12月2日 Django 3.0 へようこそ! このリリースノートでは、 バージョン 3.0 の新機能 と、Django 2.2 以前からアップグレードする際に注意すべき、 後方互換性のない変更 について説明します。 非推奨サイクルが終了した機能 ... loying with ASGI if you want to learn more. Note that as a side-effect of this change, Django is now aware of asynchronous event loops and will block you calling code marked as "async unsafe" - such as ORM operations - from an asynchronous context. If ... le asterisk '*' . On MySQL 8.0.16+, PositiveIntegerField and PositiveSmallIntegerField now include a check constraint to prevent negative values in the database. alias=None is added to the signature of Expression.get_group_by_cols() . RegexPattern , u ...
https://man.mtool.work/django/6.1/releases/3.0.html
PREV 1 NEXT