Created
September 10, 2024 02:26
-
-
Save douglasmiranda/c5d5a605ba42251b82da37b33231449d to your computer and use it in GitHub Desktop.
Django forms.MultiWidget dict example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this dict can be accessed in get_context() | |
{ | |
"widget": { | |
"name": "publishing_dates", | |
"is_hidden": False, | |
"required": False, | |
"value": "[datetime.date(2024, 9, 5), datetime.date(2024, 9, 6), datetime.date(2024, 9, 7), datetime.date(2024, 9, 8)]", | |
"attrs": { | |
"class": "form-control", | |
"placeholder": "Data de publicação", | |
"id": "id_publishing_dates", | |
}, | |
"template_name": "django/forms/widgets/multiwidget.html", | |
"subwidgets": [ | |
{ | |
"name": "publishing_dates_0", | |
"is_hidden": False, | |
"required": False, | |
"value": "2024-09-05", | |
"attrs": { | |
"class": "form-control", | |
"placeholder": "Data de publicação", | |
"id": "id_publishing_dates_0", | |
}, | |
"template_name": "django/forms/widgets/date.html", | |
"type": "date", | |
}, | |
# ... | |
], | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment