def post_process_urls(self, urlpatterns): """ Customise URL patterns. By default, this only allows custom decorators to be specified, but you could override this method to do anything you want. """ # Test if this the URLs in the Application instance should be # available. If the feature is hidden then we don't include the URLs. if feature_hidden(self.hidable_feature_name): return patterns('') for pattern in urlpatterns: if hasattr(pattern, 'url_patterns'): self.post_process_urls(pattern.url_patterns) if not hasattr(pattern, '_callback'): continue # Look for a custom decorator decorator = self.get_url_decorator(pattern) if decorator: # Nasty way of modifying a RegexURLPattern pattern._callback = decorator(pattern._callback) return urlpatterns
def render(self, context): if not feature_hidden(self.feature_name): output = self.nodelist.render(context) return output else: return ''