1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Refs #25778 -- Updated some links and references to HTTPS.

This commit is contained in:
Adam Johnson
2023-11-28 16:57:48 +00:00
committed by Mariusz Felisiak
parent 134cde8415
commit 272ceb9584
13 changed files with 62 additions and 62 deletions

View File

@@ -173,13 +173,13 @@ field is initialized to a particular value. For example:
>>> from django import forms
>>> class CommentForm(forms.Form):
... name = forms.CharField(initial="Your name")
... url = forms.URLField(initial="http://")
... url = forms.URLField(initial="https://")
... comment = forms.CharField()
...
>>> f = CommentForm(auto_id=False)
>>> print(f)
<div>Name:<input type="text" name="name" value="Your name" required></div>
<div>Url:<input type="url" name="url" value="http://" required></div>
<div>Url:<input type="url" name="url" value="https://" required></div>
<div>Comment:<input type="text" name="comment" required></div>
You may be thinking, why not just pass a dictionary of the initial values as
@@ -193,7 +193,7 @@ and the HTML output will include any validation errors:
... url = forms.URLField()
... comment = forms.CharField()
...
>>> default_data = {"name": "Your name", "url": "http://"}
>>> default_data = {"name": "Your name", "url": "https://"}
>>> f = CommentForm(default_data, auto_id=False)
>>> print(f)
<div>Name:
@@ -201,7 +201,7 @@ and the HTML output will include any validation errors:
</div>
<div>Url:
<ul class="errorlist"><li>Enter a valid URL.</li></ul>
<input type="url" name="url" value="http://" required aria-invalid="true">
<input type="url" name="url" value="https://" required aria-invalid="true">
</div>
<div>Comment:
<ul class="errorlist"><li>This field is required.</li></ul>
@@ -219,7 +219,7 @@ validation if a particular field's value is not given. ``initial`` values are
>>> class CommentForm(forms.Form):
... name = forms.CharField(initial="Your name")
... url = forms.URLField(initial="http://")
... url = forms.URLField(initial="https://")
... comment = forms.CharField()
...
>>> data = {"name": "", "url": "", "comment": "Foo"}