... のサブクラスです: >>> [ ft . __name__ for ft in layer . field_types ] ['OFTString', 'OFTReal', 'OFTReal', 'OFTDate'] field_widths このレイヤーの各フィールドの最大フィールド幅のリストを返します: >>> layer . field_widths [80, 11, 24, 10] field_precision ... d クラス自体は値を文字列として返しますが、各サブクラスは最適な形式で値を返します: >>> city [ "Population" ] . value 102121 width このフィールドの幅を返します: >>> city [ "Name" ] . width 80 precision このフィールドの数値精度を返します。非数値フィールド ... オブジェクトです。 入力がファイルパスの場合は、そのパスからラスタがオープンされます。入力が辞書の生データの場合、パラメータ width 、 height 、 srid が必要です。入力がバイトオブジェクトの場合、GDALの仮想ファイルシステムを使用してオープンされます。 辞書入 ... ... #32072 ). Fixed a regression in Django 3.1.2 that caused the incorrect width of the admin changelist search bar on a filtered page ( #32091 ). Fixed displaying Unicode characters in forms.JSONField a ... ... tent.url myfile.get_content_size() myfile.content.size myfile.save_content_file() myfile.content.save() myfile.get_content_width() myfile.content.width myfile.get_content_height() myfile.content.height Note that the width and height attributes only ma ... ... : {% verbatim myblock %} Avoid template rendering via the {% verbatim %}{% endverbatim %} block. {% endverbatim myblock %} widthratio バーチャートなどを生成する場合のために、指定した値と最大値との比を計算し、 定数に掛けた値を返します。 例: < img src = ... "bar.png" alt = "Bar" height = "10" width = " {% widthratio this_value max_value max_width %} " > ここで this_value = 175 、 max_value = 200 であるとき、画像の幅は ... 88 ピクセルになります (175 / 200 = .875、 .875 * 100 = 87.5 から四捨五入して 88 )。 widthratio の結果を変数に入れてキャプチャーしたいことがあります。例えば blocktranslate で使う場合、次のようにできます: {% widthr ... ... f : ... car . specs = File ( f , name = path . name ) ... car . save () ... 注釈 ImageField のインスタンスでは、 height , width , size などの画像データ以外の属性は利用可能ですが、ベースとなる画像データは画像を開き直さなければ利用できません。たとえば: ... >>> from PIL import Image >>> car = Car . objects . get ( name = "57 Chevy" ) >>> car . photo . width 191 >>> car . photo . height 287 >>> image = Image . open ( car . photo ) # Raises ValueError: seek of closed file. >>> ca ... ... もラスターモデルの保存に使用できます: >>> from django.contrib.gis.gdal import GDALRaster >>> rast = GDALRaster ( ... { ... "width" : 10 , ... "height" : 10 , ... "name" : "Canyon" , ... "srid" : 4326 , ... "scale" : [ 0.1 , - 0.1 ], ... "bands" : [{ "d ... save () Note that this is equivalent to: >>> dem = Elevation . objects . create ( ... name = "Canyon" , ... rast = { ... "width" : 10 , ... "height" : 10 , ... "name" : "Canyon" , ... "srid" : 4326 , ... "scale" : [ 0.1 , - 0.1 ], ... "bands" : [{ "d ... ... トリの DE-9IM 交差行列が T*F**F*** である場合に True を返します。 トポロジー的 (Topological) メソッド GEOSGeometry. buffer ( width , quadsegs = 8 ) このジオメトリからの距離が与えられた width 以下のすべての点を表す GEOSGeometry を返す。オプションの quads ... egs キーワードは、1/4円の近似に使用するセグメントの数を設定します (デフォルトは8) 。 GEOSGeometry. buffer_with_style ( width , quadsegs = 8 , end_cap_style = 1 , join_style = 1 , mitre_limit = 5.0 ) buffer() と同じですが、バッファのスタイルをカスタ ... ... クラスがあります。 django.core.files.images.ImageFile は File のすべての属性とメソッドを継承し、さらに次のものを提供します: width [ソース] 画像の幅 (ピクセル単位)。 height [ソース] 画像の高さ(ピクセル単位)。 オブジェクトに添付されたファイルに関する追加 ... ... mageField.update_dimension_fields(force=True) が呼び出されなくなりました。ストレージバックエンドが画像をリサイズする場合、 width_field と height_field が実際の画像の幅と高さと一致しなくなります。 asgiref の最小サポートバージョンが 3.7.0 から 3.8.1 に引 ... トを除いて、削除されました。 django.contrib.postgres.fields.CIText ミックスインは削除されました。 BaseGeometryWidget の map_width と map_height 属性は削除されました。 SimpleTestCase.assertFormsetError() メソッドは削除されました。 TransactionTestCase.as ... ... して保持されるため、null 値を許容する必要があります。 ImageField class ImageField ( upload_to = None , height_field = None , width_field = None , max_length = 100 , ** options ) [ソース] FileField から全ての属性とメソッドを継承して、さらにアップロードさ ... れたオブジェクトが有効な画像であることを検証します。 FileField で使える専用の属性に加えて、 ImageField には height と width 属性があります。 これらの属性に対するクエリを容易にするために、 ImageField は以下のオプション引数を持ちます: ImageField. h ... eight_field 画像オブジェクトがセットされるたびに自動的に画像の高さが入力されるモデルフィールドの名前。 ImageField. width_field 画像オブジェクトがセットされるたびに自動的に画像の幅が入力されるモデルフィールドの名前。 pillow ライブラリを必要とし ... 2026年10月08日