> On 14 Apr 2019, at 15:10, Josh Smeaton <josh.smea...@gmail.com> 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 django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
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.

Reply via email to