Задать вопрос

Тел: +7 965 3737 888

493

Просмотров

2

Ответов

Augmented TimeField

A TimeField that lets you parse a wide variety of freeform-text time descriptions. This doesn't inherit from TimeField because it doesn't use any of its functionality.

Includes unit tests demonstrating some examples of what the parser will and won't handle.

Вопрос полезен? Да0/Нет0
file_3752.py(7.4Кб)
None

Ответы (2):

Ответpetevg:31.03.2009
Ответ полезен? Да0/Нет0

Useful, thanks :-)

I did need to add a couple lines to parse seconds to wind up with something that handled the way Django fills in a Time field by default (eg. 13:20:00), though.

Ответmike_dibernardo:11.03.2008
Ответ полезен? Да0/Нет0

Whoops -- forgot to include the unit tests. The test cases provide a pretty good sampling of the kinds of inputs it will handle.