per page, with , order by , clip by
Results of 1 - 10 of about 36 for class Media (0.011 sec.)
class (230), media (48)
フォームアセット (Media クラス) 24250
フォームアセット ( Media クラス) 魅力的で使いやすいウェブのフォームを作るには、HTML だけでは不十分です。CSS スタイルシートも必要です。さらに豪華なウィジェットを使いたければ、JavaScript を各ページに配置する必要もあるでしょう。あるページに必要 ... できます。 定数として定義されたアセット アセットを定義する最も簡単な方法は、定数とすることです。この方法を利用するには、内部 Media クラスに宣言します。内部クラスのプロパティで必要なものを定義します。 以下に例を示します。 from django import forms class C ... alendarWidget ( forms . TextInput ): class Media : css = { "all" : [ "pretty.css" ], } js = [ "animations.js" , "actions.js" ] このコードでは、 CalendarWidget を定義 ... ァイル pretty.css と JavaScript ファイル animations.js および actions.js を読み込めるようになります。 この静的定義は実行時に media というウィジェットプロパティに変換されます。 CalendarWidget インスタンスのアセットリストは、このプロパティから取得できます ...
https://man.mtool.work/django/6.1/topics/forms/media.html
モデルフィールドリファレンス 15810
モデルフィールドリファレンス このドキュメントには、Django が提供するフィールドオプション field options とフィールド型 field types を含む、 Field のすべての API リファレンスが記載されています。 注釈 フィールドは django.db.models.fields に定義 ... 可能オブジェクトとして定義することもできます。例えば def get_currencies (): return { i : i for i in settings . CURRENCIES } class Expense ( models . Model ): amount = models . DecimalField ( max_digits = 10 , decimal_places = 2 ) currency = models . Ch ... ルクラスの内部で選択肢を定義し、それぞれの値に適切に名前づけられた定数を定義するのがベストです: from django.db import models class Student ( models . Model ): FRESHMAN = "FR" SOPHOMORE = "SO" JUNIOR = "JR" SENIOR = "SR" GRADUATE = "GR" YEAR_IN_SCHOOL_CH ... がインポートされていればどこでも動作します)。 利用可能な選択肢を、組織化のために名前付きグループにまとめることもできます。 MEDIA_CHOICES = { "Audio" : { "vinyl" : "Vinyl" , "cd" : "CD" , }, "Video" : { "vhs" : "VHS Tape" , "dvd" : "DVD" , }, "unknown" ...
https://man.mtool.work/django/6.1/ref/models/fields.html
Django の admin サイト 15588
Django の admin サイト Django のパワフルな特徴の1つは、自動的に生成される admin インタフェースです。あなたのモデルクラスからメタデータを読み取り、モデル中心のインタフェースを提供します。このインタフェースのおかげで、ユーザはあなたのサイトの ... ommunity Ecosystem page. The Django Packages Admin interface grid has even more options for you! ModelAdmin のオブジェクト class ModelAdmin [ソース] ModelAdmin クラスは、admin インターフェース内でモデルを表現する方法です。通常、アプリケーション内の ad ... min.py に記述されます。 ModelAdmin の例を見てみましょう: from django.contrib import admin from myapp.models import Author class AuthorAdmin ( admin . ModelAdmin ): pass admin . site . register ( Author , AuthorAdmin ) いつでも ModelAdmin オブジェクト ... ューを追加したり変更したりするために、CSS や JavaScript を追加したいことがあるかもしれません。そういうときには ModelAdmin の Media インナークラスを使用します: class ArticleAdmin ( admin . ModelAdmin ): class Media : css = { "all" : [ "my_styles.css" ], ...
https://man.mtool.work/django/6.1/ref/contrib/admin/
ウィジェット 15127
ウィジェット ウィジェットは、Django が HTML の input 要素の表現方法です。ウィジェットは、HTML のレンダリングをコントロールして、ウィジェットに合致する GET/POST ディクショナリからデータを取り出します。 Built-in widgets によって作られる HTML ... フィールドに別のウィジェットを使用したい場合は、フィールド定義で widget 引数を使用できます。例えば: from django import forms class CommentForm ( forms . Form ): name = forms . CharField () url = forms . URLField () comment = forms . CharField ( widget = ... CES = [ "1980" , "1981" , "1982" ] FAVORITE_COLORS_CHOICES = { "blue" : "Blue" , "green" : "Green" , "black" : "Black" , } class SimpleForm ( forms . Form ): birth_year = forms . DateField ( widget = forms . SelectDateWidget ( years = BIRTH_YEAR_CHOIC ... javascript ) 、およびより詳細にカスタマイズされた見た目や動作を追加できます。 要するに、ウィジェットをサブクラス化して、 "Media" 内部クラスの定義 か "media" プロパティの作成 のどちらかをする必要があります。 これらのメソッドにはやや高度なPythonプログラ ...
https://man.mtool.work/django/6.1/ref/forms/widgets.html
クラスベースのビューでフォームを扱う 15093
クラスベースのビューでフォームを扱う フォームの処理には、一般に3つの場合分けが存在します。 最初の GET リクエスト (空白またはデフォルト値が埋め込まれたフォームを返す) 無効なデータの POST リクエスト (よくあるパターンは、エラー表示を追加したフ ... ビューを用意しています。 基本的なフォーム 以下のようなコンタクトフォームがあったとします。 forms.py from django import forms class ContactForm ( forms . Form ): name = forms . CharField () message = forms . CharField ( widget = forms . Textarea ) def se ... iew を使うことで構築できます。 views.py from myapp.forms import ContactForm from django.views.generic.edit import FormView class ContactFormView ( FormView ): template_name = "contact.html" form_class = ContactForm success_url = "/thanks/" def form_va ... ixin : """ Mixin to add JSON support to a form. Must be used with an object-based FormView (e.g. CreateView). """ accepted_media_types = [ "text/html" , "application/json" ] def dispatch ( self , request , * args , ** kwargs ): if request . get_prefer ...
https://man.mtool.work/django/6.1/topics/class-based-views/generic-editing.html
ファイルの管理 14362
ファイルの管理 この文書では、ユーザがアップロードしたようなファイルに対する Django のファイルアクセス API について説明します。下位レベルの API は十分一般的なので、他の目的にも使えます。"静的ファイル" (JS や CSS など) を扱いたい場合は、 静的 ... ファイル (画像、JavaScript、CSS など) を管理する を参照してください。 デフォルトでは、Django は MEDIA_ROOT と MEDIA_URL の設定を使って、ファイルをローカルに保存します。以下の例では、これらのデフォルトを使うことを前提にしてい ... に使える API を提供します。 次のモデルを考えてみましょう。 ImageField を使って写真を保存します: from django.db import models class Car ( models . Model ): name = models . CharField ( max_length = 255 ) price = models . DecimalField ( max_digits = 5 , de ... Chevy" ) >>> car . photo <ImageFieldFile: cars/chevy.jpg> >>> car . photo . name 'cars/chevy.jpg' >>> car . photo . path '/media/cars/chevy.jpg' >>> car . photo . url 'https://media.example.com/cars/chevy.jpg' このオブジェクト(例では car.photo )は F ...
https://man.mtool.work/django/6.1/topics/files.html
Django 1.3 リリースノート 13853
Django 1.3 リリースノート March 23, 2011 Django 1.3 へようこそ! Nearly a year in the making, Django 1.3 includes quite a few new features and plenty of bug fixes and improvements to existing features. These release notes cover the new featu ... requests, but that hasn't prevented a few fairly significant new features from landing, including: A framework for writing class-based views . Built-in support for using Python's logging facilities . Contrib support for easy handling of static files . ... r the release of Django 1.3. Django 1.3 の新機能 クラスを使ったビュー Django 1.3 adds a framework that allows you to use a class as a view. This means you can compose a view out of a collection of methods that can be subclassed and overridden to provi ... les handling Django 1.3 ships with a new contrib app -- django.contrib.staticfiles -- to help developers handle the static media files (images, CSS, JavaScript, etc.) that are needed to render a complete web page. In previous versions of Django, it wa ...
https://man.mtool.work/django/6.1/releases/1.3.html
GeoDjango フォーム API 13741
GeoDjango フォーム API GeoDjango はジオローカライズされたデータを地図上に視覚的に表示・編集するために、いくつかの特殊なフォームフィールドとウィジェットを提供します。デフォルトでは、 NASA が提供する WMS レイヤーをベースとした OpenLayers を利 ... itimately deep geometries, since doing so reduces protection against fatal errors. フォームフィールド クラス GeometryField class GeometryField [ソース] PointField class PointField [ソース] LineStringField class LineStringField [ソース] PolygonField cl ... ass PolygonField [ソース] MultiPointField class MultiPointField [ソース] MultiLineStringField class MultiLineStringField [ソース] MultiPolygonField class MultiPolygonFiel ... 上でホストされている ol.js および ol.css ファイルを読み込みます。これらのファイルは、ウィジェットをサブクラス化し、内部の Media クラスの js および css プロパティを設定することで上書きできます( 定数として定義されたアセット を参照)。 CSP を適用する外 ...
https://man.mtool.work/django/6.1/ref/contrib/gis/forms-api.html
Django 1.4 リリースノート 13156
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 ... go 1.4 supports integration with in-browser testing frameworks like Selenium . The new django.test.LiveServerTestCase base class lets you test the interactions between your site's front and back ends more comprehensively. See the documentation for mor ... nes now only allow those actions for which the user has permission. For ManyToMany relationships with an auto-created intermediate model (which does not have its own permissions), the change permission for the related model determines if the user has ... form wizard The previous FormWizard from django.contrib.formtools has been replaced with a new implementation based on the class-based views introduced in Django 1.3. It features a pluggable storage API and doesn't require the wizard to pass around hi ...
https://man.mtool.work/django/6.1/releases/1.4.html
Django 1.10 リリースノート 13019
Django 1.10 リリースノート 2016年8月1日 Django 1.10 へようこそ! このリリースノートでは、 バージョン 1.10 の新機能 と、Django 1.9 以前からアップグレードする際に注意が必要な 後方互換性が失われた変更点 について説明します。私たちは、非推奨の期間 ... old-style of middleware described in DEP 0005 . You'll need to adapt old, custom middleware and switch from the MIDDLEWARE_CLASSES setting to the new MIDDLEWARE setting to take advantage of the improvements. Unicode ユーザー名の公式サポート The User m ... ため、必要な場合に Content-Security-Policy HTTP ヘッダーを有効にすることができるようになりました。 The new InlineModelAdmin.classes attribute allows specifying classes on inline fieldsets. Inlines with a collapse class will be initially collapsed and t ... it easier to implement custom storages that don't use the os.path calls previously in FileField . フォーム Form and widget Media is now served using django.contrib.staticfiles if installed. The <input> tag rendered by CharField now includes a minlengt ...
https://man.mtool.work/django/6.1/releases/1.10.html
PREV 1 2 3 4 NEXT