예제 #1
0
 def _to_python(self, value, state=None):
     try:
         return helpers.duration_to_seconds(value)
     except ValueError:
         msg = _('Bad duration formatting, use Hour:Min:Sec')
         # Colons have special meaning in error messages
         msg.replace(':', ':')
         raise Invalid(msg, value, state)
예제 #2
0
 def _to_python(self, value, state=None):
     try:
         return helpers.duration_to_seconds(value)
     except ValueError:
         msg = _('Bad duration formatting, use Hour:Min:Sec')
         # Colons have special meaning in error messages
         msg.replace(':', ':')
         raise Invalid(msg, value, state)