Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/workflows/labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false

- name: "Check title and manage labels"
uses: actions/github-script@v8
with:
Expand Down
12 changes: 6 additions & 6 deletions docs/intro/tutorial07.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,12 @@ the database. Django knows that a :class:`~django.db.models.ForeignKey` should
be represented in the admin as a ``<select>`` box. In our case, only one
question exists at this point.

Also note the "Add another question" link next to "Question." Every object with
a ``ForeignKey`` relationship to another gets this for free. When you click
"Add another question", you'll get a popup window with the "Add question" form.
If you add a question in that window and click "Save", Django will save the
question to the database and dynamically add it as the selected choice on the
"Add choice" form you're looking at.
Also note the "Add another question" button (displayed as a plus sign) to the
right of the "Question" field. Every ``ForeignKey`` relationship gets this
button for free. When you click this button, you'll get a popup window with the
"Add question" form. If you add a question in that window and click "Save",
Django will save the question to the database and dynamically add it as the
selected choice on the "Add choice" form you're looking at.

But, really, this is an inefficient way of adding ``Choice`` objects to the
system. It'd be better if you could add a bunch of Choices directly when you
Expand Down
23 changes: 23 additions & 0 deletions docs/ref/forms/widgets.txt
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,29 @@ These widgets make use of the HTML elements ``input`` and ``textarea``.
:doc:`/topics/i18n/formatting`. ``%U``, ``%W``, and ``%j`` formats are not
supported by this widget.

.. admonition:: Using the HTML5 "date" input type

If you are targeting browsers that support the
`HTML5 "date" input type`_, you can override the ``input_type``
attribute to enable the browser’s native date picker::

class MyDateInput(forms.DateInput):
input_type = "date"
format = "%Y-%m-%d"

Alternatively::

DateInput(attrs={"type": "date"}, format="%Y-%m-%d")

HTML5 date inputs expect values in the ISO format ``YYYY-MM-DD``. If a
different format is provided, the field may appear empty even when a
value exists. Setting the ``format`` attribute controls how Django
provides the value, but the browser controls how it is displayed.
Hence, the ``format`` attribute and the :setting:`DATE_INPUT_FORMATS`
setting will have no effect on the displayed value.

.. _HTML5 "date" input type: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date

``DateTimeInput``
~~~~~~~~~~~~~~~~~

Expand Down
2 changes: 2 additions & 0 deletions zizmor.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
rules:
dangerous-triggers:
# Before ignoring a file, assume all inputs are malicious, assign explicit
# minimal permissions, and do not use actions/checkout.
ignore:
- coverage_comment.yml
- labels.yml
Expand Down
Loading