+from datetime import date
from functools import wraps
from django.db.models import Count
return value
return wrapped
return decorator
+
+
+def parse_isodate(isodate):
+ try:
+ return date(*[int(p) for p in isodate.split('-')])
+ except (AttributeError, TypeError, ValueError):
+ raise ValueError("Not a date in ISO format.")