Added PeriodConverter to convert a period specification to a period, and applied it in the URL patterns.
This commit is contained in:
@ -102,6 +102,10 @@ class Period:
|
||||
def description(self):
|
||||
return self._period.description
|
||||
|
||||
@property
|
||||
def error(self):
|
||||
return self._period.error
|
||||
|
||||
@staticmethod
|
||||
def _get_last_month_start():
|
||||
"""Returns the first day of the last month.
|
||||
|
@ -86,7 +86,7 @@ def url_period(context, period_spec):
|
||||
request.resolver_match.app_name,
|
||||
request.resolver_match.url_name)
|
||||
kwargs = request.resolver_match.kwargs
|
||||
kwargs["period_spec"] = period_spec
|
||||
kwargs["period"] = period_spec
|
||||
return reverse(view_name, kwargs=kwargs)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user