1. Jason Moiron
  2. django-selector


jmo...@jmoiron.net  committed 72ed5ba

change the failover `default_autowrap` value to True rather than False on the branch where the user has no django settings module (like, for instance, for django-selector's tests); I think this is consistent with the documentation, which claims that it will disable autowrapping if you have the settings.py setting set to False, or if you pass False.

  • Participants
  • Parent commits f086f12
  • Branches default

Comments (0)

Files changed (1)

File dselector.py

View file
  • Ignore whitespace
     backwards compatible with regular django url definitions.  You can set the
     default autowrap value with ``settings.SELECTOR_AUTOWRAP``."""
     def __init__(self, autowrap=None, **extra_patterns):
+        # note that the only way to get False here is to:
+        #  set SELECTOR_AUTOWRAP=False in settings.py
+        #  pass autowrap=False to Parser.__init__
             from django.conf import settings
             default_autowrap = getattr(settings, 'SELECTOR_AUTOWRAP', True)
-            default_autowrap = False
+            default_autowrap = True
         self.autowrap = default_autowrap if autowrap is None else autowrap
         self.pattern_types = pattern_types.copy()
         for key, val in extra_patterns.iteritems():