1
0
mirror of https://github.com/django/django.git synced 2025-10-24 22:26:08 +00:00

Fixed #11585 -- Added ability to translate and prefix URL patterns with a language code as an alternative method for language discovery. Many thanks to Orne Brocaar for his initial work and Carl Meyer for feedback.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16405 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jannis Leidel
2011-06-15 17:29:10 +00:00
parent 62bb4b8c37
commit 896e3c69c7
29 changed files with 750 additions and 57 deletions

View File

@@ -346,12 +346,12 @@ def extract_views_from_urlpatterns(urlpatterns, base=''):
"""
views = []
for p in urlpatterns:
if hasattr(p, '_get_callback'):
if hasattr(p, 'callback'):
try:
views.append((p._get_callback(), base + p.regex.pattern))
views.append((p.callback, base + p.regex.pattern))
except ViewDoesNotExist:
continue
elif hasattr(p, '_get_url_patterns'):
elif hasattr(p, 'url_patterns'):
try:
patterns = p.url_patterns
except ImportError: