@@ -0,0 +1,657 @@
+import datetime%0Aimport re%0A%0Afrom django import forms%0A%0AINTERVAL_RE = re.compile(%0A    r'%5E((?P%3Cdays%3E%5Cd+) days)?,?%5CW*'%0A    r'((?P%3Chours%3E%5Cd%5Cd?)(:(?P%3Cminutes%3E%5Cd%5Cd)(:(?P%3Cseconds%3E%5Cd%5Cd))?)?)?'%0A)%0A%0Adef build_interval(data):%0A    match = INTERVAL_RE.match(data)%0A    if match:%0A        return datetime.timedelta(**dict(%0A            (key,int(value)) for key,value in match.groupdict().items() if value is not None%0A        ))%0A%0Aclass IntervalField(forms.CharField):%0A    def clean(self, value):%0A        if value:%0A            if not INTERVAL_RE.match(value):%0A                raise forms.ValidationError('Does not match interval format.')%0A            return build_interval(value)

Add an INTERVAL form field.