Opened 12 years ago
Closed 12 years ago
#19801 closed Cleanup/optimization (fixed)
input_formats sample codes missing the required parenthesis
Reported by: | Owned by: | Marcin Biernat | |
---|---|---|---|
Component: | Documentation | Version: | 1.4 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
In the Form Fields documentation, the DateField and DateTimeField examples of input_formats attribute are defined as lists, but the examples are not clear about that.
My suggestion is to use the parenthesis to enclosure the example, in order to be clear about this requirement :-)
( <------------- add this '%b %d %Y', # 'Oct 25 2006' '%b %d, %Y', # 'Oct 25, 2006' '%d %b %Y', # '25 Oct 2006' '%d %b, %Y', # '25 Oct, 2006' '%B %d %Y', # 'October 25 2006' '%B %d, %Y', # 'October 25, 2006' '%d %B %Y', # '25 October 2006' '%d %B, %Y', # '25 October, 2006' ) <------------ and this
Change History (6)
comment:1 by , 12 years ago
comment:2 by , 12 years ago
I don't feel strongly about this, but they look a little ugly/out of place which is probably why they were omitted in the first place. Right below input_formats
it says "A list of formats" which seems pretty clear to me.
comment:3 by , 12 years ago
Triage Stage: | Unreviewed → Accepted |
---|
I don't have a strong opinion either, but I'd lean slightly towards explicitly making it a list, at least in the first example where we are showing the default value. I think the opening bracket could be placed at the beginning of the first line, rather than on its own line. Also: brackets, not parens. If we're calling it a list, let's make it a list, not a tuple.
(Anyone with a strong opinion on the aesthetics here, feel free to override me and close this wontfix, I'm just trying to get it off the unreviewed list :-) )
comment:4 by , 12 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:5 by , 12 years ago
Have a possible fix at https://github.com/reecelong/django/compare/ticket_19801
comment:6 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Form Fields URL:
https://docs.djangoproject.com/en/dev/ref/forms/fields/#datefield