per page, with , order by , clip by
Results of 1 - 10 of about 18 for image (0.010 sec.)
フォーム フィールド 13486
フォーム フィールド class Field [ソース] Form クラスを作成時の一番重要な部分は、form のフィールド (field) の定義です。各フィールドにはカスタムの検証ロジックがあり、他にいくつかのフックもあります。 Field. clean ( value ) [ソース] Field クラス ... oth' に設定されている場合にだけ使用できます。 max_length デフォルトは 39 で、 CharField に対する場合と同様の動作をします。 ImageField class ImageField ( ** kwargs ) [ソース] デフォルトのウィジェット: ClearableFileInput 空の値: None ファイルコンテンツと ... 拡張子が Pillow でサポートされているかを検証します。 エラーメッセージのキー: required , invalid , missing , empty , invalid_image ImageField を使用するには、使用する画像形式に対応した pillow がインストールされている必要があります。画像をアップロードした ... 際に corrupt image エラーが発生した場合、それは通常 Pillow がその形式を理解していないことを意味します。これを修正するには、適切なライブラリを ...
https://man.mtool.work/django/6.1/ref/forms/fields.html
ファイルの管理 12182
ファイルの管理 この文書では、ユーザがアップロードしたようなファイルに対する Django のファイルアクセス API について説明します。下位レベルの API は十分一般的なので、他の目的にも使えます。"静的ファイル" (JS や CSS など) を扱いたい場合は、 静的 ... います。このドキュメントの後半では、それらのストレージシステムの働きについて説明します。 モデルでファイルを使う FileField や ImageField を使うと、 Django はそのファイルを扱うために使える API を提供します。 次のモデルを考えてみましょう。 ImageField を使っ ... ls . CharField ( max_length = 255 ) price = models . DecimalField ( max_digits = 5 , decimal_places = 2 ) photo = models . ImageField ( upload_to = "cars" ) specs = models . FileField ( upload_to = "specs" ) どの Car インスタンスにも photo 属性があり、 ... それを使って添付写真の詳細を見ることができます: >>> car = Car . objects . get ( name = "57 Chevy" ) >>> car . photo <ImageFieldFile: cars/chevy.jpg> >>> car . photo . name 'cars/chevy.jpg' >>> car . photo . path '/media/cars/chevy.jpg' >>> car . ...
https://man.mtool.work/django/6.1/topics/files.html
メールを送信する 10723
メールを送信する Django provides wrappers for Python's email and smtplib modules to simplify composing and sending email. Django's email framework also supports swapping in different delivery mechanisms: you can direct email to the console ... e MIME content type will be guessed from the filename of the attachment. 例: message . attach ( "design.png" , img_data , "image/png" ) If you specify a mimetype of message/rfc822 , content can be a django.core.mail.EmailMessage or Python's email.mess ... a single Python MIMEPart object. This will be attached directly to the resulting message. For example, to attach an inline image with a Content-ID : import email.utils from email.message import MIMEPart from django.core.mail import EmailMultiAlternati ... ves message = EmailMultiAlternatives ( ... ) image_data_bytes = ... # Load image as bytes # Create a random Content-ID, including angle brackets cid = email . utils . make_m ...
https://man.mtool.work/django/6.1/topics/email.html
バリデータ (Validator) 8939
バリデータ (Validator) バリデータを記述する バリデータ (validator) は呼び出し可能なオブジェクトで、値を受け取り、ある基準を満たしていない場合に ValidationError を発生させます。バリデータは異なるタイプのフィールド間でバリデーションロジックを ... ァイル拡張子の検証に依存しないでください。ファイル名は、どんなデータを含んでいても、どんな拡張子にも変更できます。 validate_image_file_extension validate_image_file_extension [ソース] Uses Pillow to ensure that value.name ( value is a File ) has a vali ... d image extension . ProhibitNullCharactersValidator class ProhibitNullCharactersValidator ( message = None , code = None ) [ソース ...
https://man.mtool.work/django/6.1/ref/validators.html
Django 1.8 リリースノート 8767
Django 1.8 リリースノート April 1, 2015 Django 1.8 へようこそ! このリリースノートでは、 バージョン 1.8 の新機能 と、Django 1.7 以前からアップグレードする際に注意すべき、 後方互換性のない変更 について説明します。 非推奨サイクルが終了した機能 ... alization commands are now automatically run by migrate . The GDAL interface now supports retrieving properties of raster (image) data file . Compatibility shims for SpatialRefSys and GeometryColumns changed in Django 1.2 have been removed. All GDAL-r ... ow accepts an empty_label argument, which will override the top list choice label when DateField is not required. After an ImageField has been cleaned and validated, the UploadedFile object will have an additional image attribute containing the Pillow ... Image instance used to check if the file was a valid image. It will also update UploadedFile.content_type with the image's conte ...
https://man.mtool.work/django/6.1/releases/1.8.html
テストに関する高度なトピック 8441
テストに関する高度なトピック RequestFactory(リクエスト ファクトリ) class RequestFactory [ソース] RequestFactory はテストクライアントと同じ API を共有しています。しかし、ブラウザのように動作するのではなく、 RequestFactory は任意のビューの最 ... ようにすることができます: import os from django.test import TestCase from django.test.testcases import SerializeMixin class ImageTestCaseMixin ( SerializeMixin ): lockfile = __file__ def setUp ( self ): self . filename = os . path . join ( temp_storage ... _dir , "my_file.png" ) self . file = create_file ( self . filename ) class RemoveImageTests ( ImageTestCaseMixin , TestCase ): def test_remove_image ( self ): os . remove ( self . filename ) self . assertFalse ... ( os . path . exists ( self . filename )) class ResizeImageTests ( ImageTestCaseMixin , TestCase ): def test_resize_image ( self ): resize_image ( self . file , ( 48 , 48 )) self . a ...
https://man.mtool.work/django/6.1/topics/testing/advanced.html
Django 1.11 リリースノート 8115
Django 1.11 リリースノート April 4, 2017 Django 1.11 へようこそ! このリリースノートでは、Django 1.10 および過去のバージョンからアップグレードする際に知っておくべきいくつかの 後方互換性のない変更 に加え、 新機能 を説明しています。 いくつかの ... モデル QuerySet.update_or_create() と get_or_create() の defaults 属性で呼び出し可能な値に対するサポートが追加されました。 ImageField now has a default validate_image_file_extension validator. (This validator moved to the form field in Django 1.11.2 . ... you want to disable that. バリデータ ファイル拡張子を検証する FileExtensionValidator と、 画像ファイルを検証する validate_image_file_extension を追加しました。 1.11 における後方互換性のない変更 django.contrib.gis To simplify the codebase and because ... xtra_attrs=None, **kwargs to base_attrs, extra_attrs=None . File-like objects (e.g., StringIO and BytesIO ) uploaded to an ImageField using the test client now require a name attribute with a value that passes the validate_image_file_extension validat ...
https://man.mtool.work/django/6.1/releases/1.11.html
Django の admin サイト 7961
Django の admin サイト Django のパワフルな特徴の1つは、自動的に生成される admin インタフェースです。あなたのモデルクラスからメタデータを読み取り、モデル中心のインタフェースを提供します。このインタフェースのおかげで、ユーザはあなたのサイトの ... lds import GenericForeignKey from django.contrib.contenttypes.models import ContentType from django.db import models class Image ( models . Model ): image = models . ImageField ( upload_to = "images" ) content_type = models . ForeignKey ( ContentType ... "object_id" ) class Product ( models . Model ): name = models . CharField ( max_length = 100 ) Product の追加/変更ビューで Image インスタンスの編集や作成を可能にしたい場合、 admin によって提供される GenericTabularInline や GenericStackedInline (どちら ... om django.contrib import admin from django.contrib.contenttypes.admin import GenericTabularInline from myapp.models import Image , Product class ImageInline ( GenericTabularInline ): model = Image class ProductAdmin ( admin . ModelAdmin ): inlines = [ ...
https://man.mtool.work/django/6.1/ref/contrib/admin/
GDAL API 7789
GDAL API 概要 GDAL stands for Geospatial Data Abstraction Library , and is a veritable "Swiss army knife" of GIS data functionality. A subset of GDAL is the OGR Simple Features Library, which specializes in reading and writing vector geogra ... which contains one or more layers of data named bands. Each band, represented by a GDALBand object, contains georeferenced image data. For example, an RGB image is represented as three bands: one for red, one for green, and one for blue. 注釈 ラスター ... 100 ], ... "bands" : [{ "data" : range ( 36 ), "nodata_value" : 99 }], ... } ... ) >>> HttpResponse ( rast . vsi_buffer , "image/tiff" ) 警告 The memory-based virtual filesystem doesn't make untrusted raster data safe. Raster data may reference local ...
https://man.mtool.work/django/6.1/ref/contrib/gis/gdal.html
フォーム API 7789
フォーム API このドキュメントについて このドキュメントでは、Django のフォーム API の詳細について説明します。このドキュメントを読む前に フォームについての概要 を読むことをおすすめします。 バインドされた (bound) フォームとバインドされていない ... tings.py FORM_RENDERER = "mysite.renderers.CustomRenderer" アップロードされたファイルをフォームにバインドする FileField と ImageField フィールドを持つフォームを扱うのは、通常のフォームよりも少し複雑です。 まず、ファイルをアップロードするには、 <form> ... ァイルデータをバインドする必要があります。ファイルデータは通常のフォームデータとは別に扱われるため、フォームに FileField や ImageField が含まれている場合、フォームをバインドする際に第2引数を指定する必要があります。したがって、 ImageField を mugshot とい ... う名前で ContactForm に追加した場合、mugshot イメージを含むファイルデータをバインドする必要があります: # Bound form with an image field >>> from django.core.files.uploadedfile import SimpleUploadedFile >>> data = { ... "subject" : "hello" , ... "messag ...
https://man.mtool.work/django/6.1/ref/forms/api.html
PREV 1 2 NEXT