per page, with , order by , clip by
Results of 1 - 10 of about 96 for required (0.008 sec.)
フォーム API 14170
フォーム API このドキュメントについて このドキュメントでは、Django のフォーム API の詳細について説明します。このドキュメントを読む前に フォームについての概要 を読むことをおすすめします。 バインドされた (bound) フォームとバインドされていない ... >> f . is_valid () True Let's try with some invalid data. In this case, subject is blank (an error, because all fields are required by default) and contact_email is not a valid email address: >>> data = { ... "subject" : "" , ... "message" : "Hi there" , ... se Form. errors errors 属性にアクセスして、エラーメッセージの辞書を取得します。 >>> f . errors {'subject': ['This field is required.'], 'contact_email': ['Enter a valid email address.']} この辞書では、キーはフィールド名であり、値はエラーメッセージを表す文 ... or インスタンスをマッピングする dict を返します。 >>> f . errors . as_data () {'subject': [ValidationError(['This field is required.'])], 'contact_email': [ValidationError(['Enter a valid email address.'])]} Use this method anytime you need to identify a ...
https://man.mtool.work/django/6.1/ref/forms/api.html
フォーム フィールド 13789
フォーム フィールド class Field [ソース] Form クラスを作成時の一番重要な部分は、form のフィールド (field) の定義です。各フィールドにはカスタムの検証ロジックがあり、他にいくつかのフックもあります。 Field. clean ( value ) [ソース] Field クラス ... 。 Field クラスによっては追加のフィールド固有の引数も取れることがありますが、以下に説明する引数は 常に 取ることができます。 required Field. required デフォルトでは、各 Field クラスは値が必須であると想定しているため、空の値 ( None もしくは空文字列 ( "" )) ... >> f . clean ( "foo" ) 'foo' >>> f . clean ( "" ) Traceback (most recent call last): ... ValidationError : ['This field is required.'] >>> f . clean ( None ) Traceback (most recent call last): ... ValidationError : ['This field is required.'] >>> f . cle ... clean ( True ) 'True' >>> f . clean ( False ) 'False' フィールドが必須で ない ことを指定するには、 Field コンストラクタに required=False を渡します: >>> f = forms . CharField ( required = False ) >>> f . clean ( "foo" ) 'foo' >>> f . clean ( "" ) '' >>> ...
https://man.mtool.work/django/6.1/ref/forms/fields.html
Djangoの認証システムを使用する 10309
Djangoの認証システムを使用する このドキュメントでは、デフォルト設定でのDjangoの認証システムの使用方法を説明します。この設定は、タスクの適切な範囲を管理することで、最も一般的なプロジェクトのニーズにかなうよう徐々に発展してきました。そして、パ ... w ( request ): if not request . user . is_authenticated : return render ( request , "myapp/login_error.html" ) # ... login_required デコレータ login_required ( redirect_field_name = 'next' , login_url = None ) [ソース] ショートカットとして、便利な login_ ... required() デコレータを利用できます: from django.contrib.auth.decorators import login_required @login_required def my_view ( request ): ... login_required() は下記の処理を行います: もしユーザがログインしていなければ、 ... レクトされる先のパスは "next" という名称のクエリパラメータに格納されています。もし異なるパラメータ名を利用したい場合、 login_required() が redirect_field_name という省略可能な引数を受け取ります。 from django.contrib.auth.decorators import login_required @l ...
https://man.mtool.work/django/6.1/topics/auth/default.html
ウィジェット 9179
ウィジェット ウィジェットは、Django が HTML の input 要素の表現方法です。ウィジェットは、HTML のレンダリングをコントロールして、ウィジェットに合致する GET/POST ディクショナリからデータを取り出します。 Built-in widgets によって作られる HTML ... Field ( widget = forms . SelectDateWidget ( years = BIRTH_YEAR_CHOICES ) ) favorite_colors = forms . MultipleChoiceField ( required = False , widget = forms . CheckboxSelectMultiple , choices = FAVORITE_COLORS_CHOICES , ) 使用可能なウィジェットとそれぞれ ... や追加の属性はありません。 >>> f = CommentForm ( auto_id = False ) >>> print ( f ) <div>Name:<input type="text" name="name" required></div> <div>Url:<input type="url" name="url" required></div> <div>Comment:<input type="text" name="comment" required></div ... になります: >>> f = CommentForm ( auto_id = False ) >>> print ( f ) <div>Name:<input type="text" name="name" class="special" required></div> <div>Url:<input type="url" name="url" required></div> <div>Comment:<input type="text" name="comment" size="40" requ ...
https://man.mtool.work/django/6.1/ref/forms/widgets.html
PostgreSQL 固有のフォームフィールドとウィジェット 9061
PostgreSQL 固有のフォームフィールドとウィジェット これらのフィールドやウィジェットはすべて django.contrib.postgres.forms モジュールから利用できます。 フィールド SimpleArrayField class SimpleArrayField ( base_field , delimiter = ',' , max_le ... のそれぞれの値が保存されます。 True に設定すると、末尾の値が空白の場合、その値は結果から取り除かれます。基となるフィールドが required=True で、かつ remove_trailing_nulls が True の場合、末尾にのみ null 値が許され、その値は取り除かれます。 例: SplitArrayFie ... ld ( IntegerField ( required = True ), size = 3 , remove_trailing_nulls = False ) [ "1" , "2" , "3" ] # -> [1, 2, 3] [ "1" , "2" , "" ] # -> Validation ... Error - third entry required. [ "1" , "" , "3" ] # -> ValidationError - second entry required. [ "" , "2" , "" ] # -> ValidationError - first and third ...
https://man.mtool.work/django/6.1/ref/contrib/postgres/forms.html
Django 1.2 リリースノート 8312
Django 1.2 リリースノート 2010 年 5 月 17 日 Django 1.2 へようこそ! Nearly a year in the making, Django 1.2 packs an impressive list of new features and lots of bug fixes. These release notes cover the new features, as well as important cha ... l flow tags) should ensure that their code follows the new rules for stateful template tags The user_passes_test() , login_required() , and permission_required() , decorators from django.contrib.auth only apply to functions and no longer work on methods. ... thon versions from 2.3 up; Django 1.2, however, drops official support for Python 2.3. As such, the minimum Python version required for Django is now 2.4, and Django is tested and supported on Python 2.4, 2.5 and 2.6, and will be supported on the as-yet- ... False ): ... def get_db_prep_lookup ( self , lookup_type , value , connection , prepared = False ): ... These changes are required to support multiple databases -- db_type and get_db_prep_* can no longer make any assumptions regarding the database for w ...
https://man.mtool.work/django/6.1/releases/1.2.html
クラスベースビュー入門 8194
クラスベースビュー入門 クラスベースビューはビューを実装するもう一つの手段で、関数の代わりに Python のオブジェクトとしてビューを定義します。クラスベースビューは関数ベースのビューを完全に置き換えるものではありませんが、関数ベースのビューと比較 ... ます。これが最も簡単にできる場所は、ビューをデプロイする URLconf の中です。 from django.contrib.auth.decorators import login_required , permission_required from django.views.generic import TemplateView from .views import VoteView urlpatterns = [ path ( "ab ... out/" , login_required ( TemplateView . as_view ( template_name = "secret.html" ))), path ( "vote/" , permission_required ( "polls.can_vote" )( V ... ドのデコレーションに使えるようにできます。たとえば、次のように使用します。 from django.contrib.auth.decorators import login_required from django.utils.decorators import method_decorator from django.views.generic import TemplateView class ProtectedView ( T ...
https://man.mtool.work/django/6.1/topics/class-based-views/intro.html
Django 5.1.6 リリースノート 7695
Django 5.1.6 リリースノート 2025年2月5日 Django 5.1.6 では、 5.1.5 におけるいくつかのバグを修正しました。 バグ修正 Fixed a regression in Django 5.1.5 that caused validate_ipv6_address() and validate_ipv46_address() to crash when handling no ... n-string values ( #36098 ). Fixed a regression in Django 5.1 where password fields, despite being set to required=False , were still treated as required in forms derived from BaseUserCreationForm ( #36140 ). ...
https://man.mtool.work/django/6.1/releases/5.1.6.html
Django 1.10 リリースノート 7446
Django 1.10 リリースノート 2016年8月1日 Django 1.10 へようこそ! このリリースノートでは、 バージョン 1.10 の新機能 と、Django 1.9 以前からアップグレードする際に注意が必要な 後方互換性が失われた変更点 について説明します。私たちは、非推奨の期間 ... les if installed. The <input> tag rendered by CharField now includes a minlength attribute if the field has a min_length . Required form fields now have the required HTML attribute. Set the new Form.use_required_attribute attribute to False to disable it ... . The required attribute isn't included on forms of formsets because the browser validation may not be correct when adding and deleting f ... to True and implement the DatabaseOperations.subtract_temporals() method. This method should return the SQL and parameters required to compute the difference in microseconds between the lhs and rhs arguments in the datatype used to store DurationField . ...
https://man.mtool.work/django/6.1/releases/1.10.html
Django 4.0 リリースノート 7446
Django 4.0 リリースノート 2021年12月7日 Django 4.0 へようこそ! このリリースノートでは、 バージョン 4.0 の新機能 と、Django 3.2 以前からアップグレードする際に注意すべき、 後方互換性のない変更 について説明します。また、 一部の機能を非推奨 とし ... ction now consults the Origin header, if present. To facilitate this, some changes to the CSRF_TRUSTED_ORIGINS setting are required. フォーム ModelChoiceField now includes the provided value in the params argument of a raised ValidationError for the inva ... ude an asterisk before the dot. For example, change '.example.com' to 'https://*.example.com' . A system check detects any required changes. Configuring it may now be required As CSRF protection now consults the Origin header, you may need to set CSRF_TR ... onsequence, any custom deletion logic in delete() handlers should be moved to form_valid() , or a shared helper method, if required. Table and column naming scheme changes on Oracle Django 4.0 inadvertently changed the table and column naming scheme on O ...
https://man.mtool.work/django/6.1/releases/4.0.html
PREV 1 2 3 4 5 6 7 8 9 10 NEXT