Permalink
Browse files

added new settings option to specify urls ro resolve - URLS_JS_TO_EXPOSE

  • Loading branch information...
Chris Reeves
Chris Reeves committed Sep 24, 2011
1 parent bff58fb commit b15b20bb11d8112f05816bd43250ffb34a04513f
Showing with 2 additions and 2 deletions.
  1. +2 −2 django_js_utils/management/commands/js_urls.py
@@ -44,7 +44,7 @@ def handle_url_module(js_patterns, module_name, prefix=""):
for pattern in patterns:
if issubclass(pattern.__class__, RegexURLPattern):
- if pattern.name:
+ if pattern.name and pattern.name in app_settings.URLS_JS_TO_EXPOSE:
full_url = prefix + pattern.regex.pattern
for chr in ["^","$"]:
full_url = full_url.replace(chr, "")
@@ -61,5 +61,5 @@ def handle_url_module(js_patterns, module_name, prefix=""):
full_url = full_url.replace(el, "<>")#replace by a empty parameter name
js_patterns[pattern.name] = "/" + full_url
elif issubclass(pattern.__class__, RegexURLResolver):
- if pattern.urlconf_name:
+ if pattern.urlconf_name and pattern.urlconf_name in app_settings.URLS_JS_TO_EXPOSE:
Command.handle_url_module(js_patterns, pattern.urlconf_name, prefix=pattern.regex.pattern)

0 comments on commit b15b20b

Please sign in to comment.