Пример #1
0
 def __call__(self, value, *args, **kw):
     error = translate(_(u"Please enter a valid timerange"), context=kw["instance"].REQUEST)
     try:
         int(value)
     except (ValueError, TypeError):
         return error
     if int(value) == 0:
         return 1
     v = getListFromTimeRange(value)
     if int(v[0][0]) < int(v[1][0]) or (int(v[0][0]) == int(v[1][0]) and int(v[0][1]) < int(v[1][1])):
         return 1
     return error
Пример #2
0
 def getTo(self, value):
     return getListFromTimeRange(value)[1]
Пример #3
0
 def getFrom(self, value):
     return getListFromTimeRange(value)[0]