> On 14 Apr 2019, at 15:10, Josh Smeaton <[email protected]> wrote:
>
> Finally, there are some tricks you pick up if black fights you on some
> decisions. To use Berkers example:
>
> TIME_INPUT_FORMATS = [
> '%H:%M:%S', # '14:30:59'
> '%H:%M:%S.%f', # '14:30:59.000200'
> '%H:%M', # '14:30'
> ]
>
> TIME_INPUT_FORMATS = ['%H:%M:%S', '%H:%M:%S.%f', '%H:%M'] # '14:30:59'
> # '14:30:59.000200' # '14:30'
>
> Break each individual format into its own variable, with appropriate comment,
> and add the variables to the list.
>
> HMS = "%H:%M:%S" # 14:30:59
> HMSF = ".."
> HM = ".."
> TIME_INPUT_FORMATS = [HMS, HMSF, HM]
>
> Obviously just an example, but something to keep in mind.
FWIW there's also this possibility:
TIME_INPUT_FORMATS = [
# '14:30:59'
'%H:%M:%S',
# '14:30:59.000200'
'%H:%M:%S.%f',
# '14:30'
'%H:%M',
]
--
Aymeric.
--
You received this message because you are subscribed to the Google Groups
"Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-developers/37026972-CFCF-45D7-8903-958C31719224%40polytechnique.org.
For more options, visit https://groups.google.com/d/optout.