Commit 276b866f authored by Bryan Hoyt's avatar Bryan Hoyt

More comprehensive & locale-friendly replacement for named url parameters.

parent bc291172
import re
import warnings import warnings
from flask import request, url_for, redirect, flash, abort, json, Response from flask import request, url_for, redirect, flash, abort, json, Response
...@@ -990,7 +991,7 @@ class BaseModelView(BaseView, ActionsMixin): ...@@ -990,7 +991,7 @@ class BaseModelView(BaseView, ActionsMixin):
will no longer work. will no longer work.
""" """
if self.named_filter_urls: if self.named_filter_urls:
return u'{name}_{operation}'.format(name=flt.name, operation=flt.operation()).lower().replace(' ', '_') return re.sub('\W', '_', u'{name}_{operation}'.format(name=flt.name, operation=flt.operation())).lower()
else: else:
return str(self._filters.index(flt)) return str(self._filters.index(flt))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment