per page, with , order by , clip by
Results of 1 - 5 of about 5 for writer (0.007 sec.)
CSVを出力する 12814
CSVを出力する このドキュメントでは、Django のビューを使って動的に CSV (Comma Separated Values) を出力する方法を説明しています。そのためには、Python のCSV ライブラリか Django のテンプレートシステムを使います。 Python の CSV ライブラリを使う ... pResponse ( content_type = "text/csv" , headers = { "Content-Disposition" : 'attachment; filename="somefilename.csv"' }, ) writer = csv . writer ( response ) writer . writerow ([ "First row" , "Foo" , "Bar" , "Baz" ]) writer . writerow ([ "Second row" ... も構いません。ここで指定した名前は、ブラウザが「別名で保存」ダイアログなどで使用します。 CSV 生成 API にフックするには、 csv.writer の最初の引数として response を渡すだけです。 csv.writer 関数はファイルライクなオブジェクトを要求しますが、 HttpResponse オ ... ブジェクトはこの要求に適合しています。 CSV ファイルの行ごとに writer.writerow を呼び、 iterable を渡します。 CSV モジュールは引用を適切に処理するので、引用符やカンマでの文字列のエスケープにつ ...
https://man.mtool.work/django/6.1/howto/outputting-csv.html
GEOS API 8640
GEOS API 背景 GEOS とは? GEOS stands for Geometry Engine - Open Source , and is a C++ library, ported from the Java Topology Suite . GEOS implements the OpenGIS Simple Features for SQL spatial predicate functions and spatial operators. GEOS ... contrib.gis.geos import WKTReader >>> wkt_r = WKTReader () >>> wkt_r . read ( "POINT(1 1)" ) <Point object at 0x103a88b50> Writer オブジェクト All writer objects have a write(geom) method that returns either the WKB or WKT of the given geometry. In add ... ition, WKBWriter objects also have properties that may be used to change the byte order, and or include the SRID value (in other words, EWK ... B). class WKBWriter ( dim = 2 ) [ソース] WKBWriter provides the most control over its output. By default it returns OGC-compliant WKB when its ...
https://man.mtool.work/django/6.1/ref/contrib/gis/geos.html
クエリ式 (Query Expression) 8457
クエリ式 (Query Expression) クエリ式 (query expression) は、update、create、filter、order by、annotation、またはaggregateの一部として使用できる値または計算を記述します。式が真偽値を出力する場合、フィルタで直接使用できます。クエリの記述に使用 ... インデックスはサポートされていません。例えば、次のように記述できます: >>> # Replacing a name with a substring of itself. >>> writer = Writers . objects . get ( name = "Priyansh" ) >>> writer . name = F ( "name" )[ 1 : 5 ] >>> writer . save () >>> writer ...
https://man.mtool.work/django/6.1/ref/models/expressions.html
モデルからフォームを作成する 8089
モデルからフォームを作成する ModelForm class ModelForm [ソース] データベース中心のアプリケーションを作成している場合、Django モデルに密接にマップするフォームを使うことになるでしょう。例えば、 BlogComment モデルを持っていて、閲覧者がコメント ... uthorForm ( ModelForm ): class Meta : model = Author fields = [ "name" , "title" , "birth_date" ] labels = { "name" : _ ( "Writer" ), } help_texts = { "name" : _ ( "Some useful help text." ), } error_messages = { "name" : { "max_length" : _ ( "This wri ...
https://man.mtool.work/django/6.1/topics/forms/modelforms.html
マイグレーション 7905
マイグレーション マイグレーション (Migrations) は、Django でモデルに対して行った変更 (フィールドの追加やモデルの削除など) をデータベーススキーマに反映させる方法です。大抵のマイグレーションは自動で行われるものの、いつマイグレーションが作られ ... にできます: from decimal import Decimal from django.db.migrations.serializer import BaseSerializer from django.db.migrations.writer import MigrationWriter class DecimalSerializer ( BaseSerializer ): def serialize ( self ): return repr ( self . value ), { ... "from decimal import Decimal" } MigrationWriter . register_serializer ( Decimal , DecimalSerializer ) MigrationWriter.register_serializer() の第一引数には、シリアライザを ...
https://man.mtool.work/django/6.1/topics/migrations.html
PREV 1 NEXT