per page, with , order by , clip by
Results of 1 - 10 of about 66 for queries (0.003 sec.)
Fetch modes 13727
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 ... the initial QuerySet . This copying is also done in related managers, even though fetch 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 the ... current instance only. This is the default mode. Using FETCH_ONE for the above example would use: 1 query to fetch books N queries, where N is the number of books, to fetch the missing author field …for a total of 1+N queries. This query pattern is know ... n as the "N+1 queries problem" because it often leads to performance issues when N is large. FETCH_PEERS Fetches the missing field for the curre ...
https://man.mtool.work/django/6.1/topics/db/fetch-modes.html
FAQ: データベースとモデル 12058
FAQ: データベースとモデル Django が実行している生の SQL クエリを見られますか? Django の設定ファイルの DEBUG が True になっていることを確認します。次に、以下のコードを実行してください。 >>> from django.db import connection >>> connection . queries ... {'sql': 'SELECT polls_polls.id, polls_polls.question, polls_polls.pub_date FROM polls_polls', 'time': '0.002'}] connection.queries は DEBUG が True の場合にのみ利用できます。これはクエリの実行順に辞書を並べたリストです。各辞書には以下の項目が入っています ... : sql - 素のSQL構文 time - ステートメントの実行に要した秒数。 connection.queries にはINSERT, UPDATE, SELECTなどの全てのSQL文が記録されています。アプリケーションがデータベースを操作するたびに、クエリが記録 ... の辞書の各要素に対して、同じコードを実行できます: >>> from django.db import connections >>> connections [ "my_db_alias" ] . queries もし、何らかの関数の中でクエリのリストをクリアする必要がある場合は、以下のように reset_queries() を実行します。 from djang ...
https://man.mtool.work/django/6.1/faq/models.html
Django 1.8.5 リリースノート 11216
Django 1.8.5 リリースノート October 3, 2015 Django 1.8.5 fixes several bugs in 1.8.4. バグ修正 Made the development server's autoreload more robust ( #24704 ). Fixed AssertionError in some delete queries with a model containing a field that ... is both a foreign and primary key ( #24951 ). Fixed AssertionError in some complex queries ( #24525 ). Fixed a migrations crash with GenericForeignKey ( #25040 ). Made translation.override() clear the overridden l ... ). Fixed migrations crash on MySQL when adding a text or a blob field with an unhashable default ( #25393 ). Changed Count queries to execute COUNT(*) instead of COUNT('*') as versions of Django before 1.8 did ( #25377 ). This may fix a performance regr ... mmit with set_autocommit(False) ( #24921 ). Fixed the manage.py test --keepdb option on Oracle ( #25421 ). Fixed incorrect queries with multiple many-to-many fields on a model with the same 'to' model and with related_name set to '+' ( #24505 , #25486 ) ...
https://man.mtool.work/django/6.1/releases/1.8.5.html
Django 2.2 リリースノート 9189
Django 2.2 リリースノート April 1, 2019 Django 2.2 へようこそ! このリリースノートでは、 バージョン 2.2 の新機能 と、Django 2.1 以前からアップグレードする際に注意すべき、 後方互換性のない変更 について説明します。また、 一部の機能を非推奨 とし ... he same language was added in Django 2.2.12. Features deprecated in 2.2 Model Meta.ordering will no longer affect GROUP BY queries A model's Meta.ordering affecting GROUP BY queries (such as .annotate().values() ) is a common source of confusion. Such q ... eprecation warning with the advice to add an order_by() to retain the current query. Meta.ordering will be ignored in such queries starting in Django 3.1. その他 django.utils.timezone.FixedOffset is deprecated in favor of datetime.timezone . The undocum ... it accepts it. Support for overrides that don't accept it will be removed in Django 3.1. The SimpleTestCase.allow_database_queries , TransactionTestCase.multi_db , and TestCase.multi_db attributes are deprecated in favor of SimpleTestCase.databases , Tr ...
https://man.mtool.work/django/6.1/releases/2.2.html
Django 1.6 リリースノート 8833
Django 1.6 リリースノート 注釈 Dedicated to Malcolm Tredinnick On March 17, 2013, the Django project and the free software community lost a very dear friend and developer. Malcolm was a long-time contributor to Django, a model community mem ... . Added FormMixin.get_prefix (which returns FormMixin.prefix by default) to allow customizing the prefix of the form. Raw queries ( Manager.raw() or cursor.execute() ) can now use the "pyformat" parameter style, where placeholders in the query are give ... he general spirit of Django's transaction management, there are a few backwards-incompatibilities. Savepoints and assertNumQueries The changes in transaction management may result in additional statements to create, release or rollback savepoints. This ... is more likely to happen with SQLite, since it didn't support savepoints until this release. If tests using assertNumQueries() fail because of a higher number of queries than expected, check that the extra queries are related to savepoints, and ad ...
https://man.mtool.work/django/6.1/releases/1.6.html
Django 3.1.2 リリースノート 8833
Django 3.1.2 リリースノート October 1, 2020 Django 3.1.2 では、3.1.1 におけるいくつかのバグを修正しました。 バグ修正 Fixed a bug in Django 3.1 where FileField instances with a callable storage were not correctly deconstructed ( #31941 ). Fi ... xed a regression in Django 3.1 where the QuerySet.ordered attribute returned incorrectly True for GROUP BY queries (e.g. .annotate().values() ) on models with Meta.ordering . A model's Meta.ordering doesn't affect such queries ( #31990 ) ...
https://man.mtool.work/django/6.1/releases/3.1.2.html
データベースの計測 8833
データベースの計測 コードから発行されたクエリを理解して制御するために、Django は、データベースクエリの実行周辺にラッパー関数をインストールするためのフックを提供しています。たとえば、ラッパーは、クエリのカウント、クエリの実行時間の測定、クエ ... as )) より完全な例として、クエリロガーは次のようになります。 import time class QueryLogger : def __init__ ( self ): self . queries = [] def __call__ ( self , execute , sql , params , many , context ): current_query = { "sql" : sql , "params" : params , ... us" ] = "ok" return result finally : duration = time . monotonic () - start current_query [ "duration" ] = duration self . queries . append ( current_query ) これを使用するには、ロガーオブジェクトを作成し、ラッパーとしてインストールします。 from django. ... db import connection ql = QueryLogger () with connection . execute_wrapper ( ql ): do_queries () # Now we can print the log. print ( ql . queries ) connection.execute_wrapper() connection. execute_wrapper ( wrapper ) ...
https://man.mtool.work/django/6.1/topics/db/instrumentation.html
Django 3.0.4 リリースノート 8704
Django 3.0.4 リリースノート March 4, 2020 Django 3.0.4では、3.0.3にあったセキュリティの問題といくつかのバグを修正しました。 CVE-2020-9402: Potential SQL injection via tolerance parameter in GIS functions and aggregates on Oracle GIS functio ... onding models were not locked ( #31246 ). Fixed a regression in Django 3.0 that caused misplacing parameters in logged SQL queries on Oracle ( #31271 ). Fixed a regression in Django 3.0.3 that caused misplacing parameters of SQL queries when subtracting ... DateField or DateTimeField expressions on MySQL ( #31312 ). Fixed a regression in Django 3.0 that didn't include subqueries spanning multivalued relations in the GROUP BY clause ( #31150 ). ...
https://man.mtool.work/django/6.1/releases/3.0.4.html
Django 1.6.3 リリースノート 8105
Django 1.6.3 リリースノート April 21, 2014 Django 1.6.3 fixes several bugs in 1.6.2, including three security issues, and makes one backwards-incompatible change: Unexpected code execution using reverse() Django's URL handling is based on a ... the response, then the response will not be cached. MySQL typecasting The MySQL database is known to "typecast" on certain queries; for example, when querying a table which contains string values, but using a query which filters based on an integer valu ... raw SQL or SQL fragments -- will be advised to ensure they perform appropriate manual type conversions prior to executing queries. select_for_update() requires a transaction Historically, queries that use select_for_update() could be executed in autoco ...
https://man.mtool.work/django/6.1/releases/1.6.3.html
Django 2.0 リリースノート 8105
Django 2.0 リリースノート December 2, 2017 Django 2.0 へようこそ! このリリースノートでは、 バージョン 2.0 の新機能 と、Django 1.11 以前からアップグレードする際に注意すべき、 後方互換性のない変更 について説明します。 非推奨サイクルが終了した ... ly Oracle supports it. The new connection.execute_wrapper() method allows installing wrappers around execution of database queries . The new filter argument for built-in aggregates allows adding different conditionals to multiple aggregations over the s ... AY_OF_WEEK and NUMBER_GROUPING format settings are now kept as integers in JavaScript and JSON i18n view outputs. assertNumQueries() now ignores connection configuration queries. Previously, if a test opened a new database connection, those queries coul ... d be included as part of the assertNumQueries() count. The default size of the Oracle test tablespace is increased from 20M to 50M and the default autoextend size is in ...
https://man.mtool.work/django/6.1/releases/2.0.html
PREV 1 2 3 4 5 6 7 NEXT