per page, with , order by , clip by
Results of 1 - 10 of about 18 for cursor (0.004 sec.)
素の SQL 文の実行 15562
素の SQL 文の実行 Django gives you three ways of performing raw SQL queries: you can embed raw SQL fragments into ORM queries using RawSQL (see Raw SQL fragments ), use Manager.raw() to perform raw queries and return model instances , or av ... のデータベースコネクションを表します。データベースコネクションを利用するには、カーソルオブジェクトを取得するため connection.cursor() を呼び出してください。そして、 cursor.execute(sql, [params]) を呼び出して SQL を実行した後、 cursor.fetchone() もしくは ... ursor.fetchall() が結果の行を返します。 例: from django.db import connection def my_custom_sql ( self ): with connection . cursor () as cursor : cursor . execute ( "UPDATE bar SET foo = 1 WHERE baz = %s " , [ self . baz ]) cursor . execute ( "SELECT fo ... o FROM bar WHERE baz = %s " , [ self . baz ]) row = cursor . fetchone () return row SQLインジェクションから保護するために、SQL文字列の %s プレースホルダの前後に引用符を含めてはいけま ...
https://man.mtool.work/django/6.1/topics/db/sql.html
Django 1.11.1 リリースノート 8888
Django 1.11.1 リリースノート May 6, 2017 Django 1.11.1 adds a minor feature and fixes several bugs in 1.11. Allowed disabling server-side cursors on PostgreSQL The change in Django 1.11 to make QuerySet.iterator() use server-side cursors on ... ostgreSQL prevents running Django with PgBouncer in transaction pooling mode. To reallow that, use the DISABLE_SERVER_SIDE_CURSORS setting in DATABASES . See トランザクションプールとサーバーサイドカーソル for more discussion. バグ修正 Made migrations r ... #28059 ). Fixed crash in BaseGeometryWidget.subwidgets() ( #28039 ). Fixed exception reraising in ORM query execution when cursor.execute() fails and the subsequent cursor.close() also fails ( #28091 ). Fixed a regression where CheckboxSelectMultiple , ...
https://man.mtool.work/django/6.1/releases/1.11.1.html
Django 1.6 リリースノート 8630
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 ... ix (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 given as '%(name)s' and the pa ... on Oracle, an exception is generated. No database change is needed for SQLite or PostgreSQL databases. Percent literals in cursor.execute queries When you are running raw SQL queries through the cursor.execute method, the rule about doubling percent li ... ral percent characters if you are also providing replacement parameters. For example: # No parameters, no percent doubling cursor . execute ( "SELECT foo FROM bar WHERE baz = '30%'" ) # Parameters passed, non-placeholders have to be doubled cursor . ex ...
https://man.mtool.work/django/6.1/releases/1.6.html
Django 3.1 リリースノート 8441
Django 3.1 リリースノート August 4, 2020 Django 3.1 へようこそ! このリリースノートでは、 バージョン 3.1 の新機能 と、Django 3.0 以前からアップグレードする際に注意すべき、 後方互換性のない変更 について説明します。 非推奨サイクルが終了した機能 ... it was None on databases that support time zones. connection._nodb_connection property is changed to the connection._nodb_cursor() method and now returns a context manager that yields a cursor and automatically closes the cursor and connection upon ex ...
https://man.mtool.work/django/6.1/releases/3.1.html
Django 1.7 リリースノート 8321
Django 1.7 リリースノート September 2, 2014 Django 1.7 へようこそ! このリリースノートでは、 バージョン 1.7 の新機能 と、Django 1.6 以前からアップグレードする際に注意すべき、 後方互換性のない変更 について説明します。 非推奨サイクルが終了した ... ser and server time zone are different, to clarify how the value inserted in the field will be interpreted. Using database cursors as context managers Prior to Python 2.7, database cursors could be used as a context manager. The specific backend's curs ... or defined the behavior of the context manager. The behavior of magic method lookups was changed with Python 2.7 and cursors were no longer usable as context managers. Django 1.7 allows a cursor to be used as a context manager. That is, the follo ... wing can be used: with connection . cursor () as c : c . execute ( ... ) 代わりに、次のようにします: c = connection . cursor () try : c . execute ( ... ) finally : c ...
https://man.mtool.work/django/6.1/releases/1.7.html
Django 1.7.1 リリースノート 8253
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 ... icInlineModelAdmin ( #23539 ). Made migrations.RunSQL no longer require percent sign escaping. This is now consistent with cursor.execute() ( #23426 ). TEST 辞書の SERIALIZE 項目を使用可能にしました ( #23421 )。 Fixed bug in migrations that prevented f ...
https://man.mtool.work/django/6.1/releases/1.7.1.html
Django 4.2.1 リリースノート 8184
Django 4.2.1 リリースノート 2023年5月3日 Django 4.2.1 では、 4.2 における深刻度 "moderate" のセキュリティの問題1件と、いくつかのバグを修正しました。 CVE-2023-31047: 1つのフォームフィールドを使用して複数のファイルをアップロードする際の検証の ... 対してグループ化されるリグレッションを修正しました ( #34464 )。 Django 4.2 のリグレッションに従い、PostgreSQL の OPTIONS で "cursor_factory" オプションを設定することを許可しました ( #34466 )。 Django 4.2のリグレッション ( #34470 ) に対処し、PostgreSQL の ...
https://man.mtool.work/django/6.1/releases/4.2.1.html
非同期サポート 8184
非同期サポート 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 ... c >>> from django.db import connection >>> # In an async context so you cannot use the database directly: >>> connection . cursor () django.core.exceptions.SynchronousOnlyOperation: You cannot call this from an async context - use a thread or sync_to_a ... sync. >>> # Nor can you pass resolved connection attributes across threads: >>> await sync_to_async ( connection . cursor )() django.db.utils.DatabaseError: DatabaseWrapper objects created in a thread can only be used in that same thread. The o ...
https://man.mtool.work/django/6.1/topics/async.html
Django 1.4 リリースノート 8133
Django 1.4 リリースノート March 23, 2012 Django 1.4 へようこそ! 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.3 or older versions. We've a ... nnections dictionary referencing those objects is still thread-local. Therefore if you just use the ORM or DatabaseWrapper.cursor() then the behavior is still the same as before. Note, however, that django.db.connection does not directly reference the ... g thread-sharing by default, so this does not affect any existing code that purely relies on the ORM or on DatabaseWrapper.cursor() . Finally, while it's now possible to pass connections between threads, Django doesn't make any effort to synchronize ac ...
https://man.mtool.work/django/6.1/releases/1.4.html
複数のデータベース 8064
複数のデータベース ここでは、Djangoがサポートする複数データベースの扱いについて説明します。残りのDjangoのドキュメントの大部分は、あなたが一つのデータベース扱うことを前提としています。複数のデータベースを使いたいなら、いくつかの追加ステップを ... ように、エイリアスを使って個別の接続を取得できます。 from django.db import connections with connections [ "my_db_alias" ] . cursor () as cursor : ... 複数データベースの制約 データベースをまたぐリレーション Djangoは現在、複数のデータベースにまたがる外部キ ...
https://man.mtool.work/django/6.1/topics/db/multi-db.html
PREV 1 2 NEXT