summaryrefslogtreecommitdiff
path: root/django/core
diff options
context:
space:
mode:
authorJason Pellerin <jpellerin@gmail.com>2006-08-04 23:27:18 +0000
committerJason Pellerin <jpellerin@gmail.com>2006-08-04 23:27:18 +0000
commit238c6ecd5b10c6c76b8b1db03dcb746bcfe366af (patch)
tree7a29f1cdb8d6c48d44441b98c0ab0a34fb4258e3 /django/core
parent08c420718200bcb0dcc5237f678d45d10173e81e (diff)
[multi-db] Merge trunk to [3522]
git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3523 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/core')
-rw-r--r--django/core/management.py6
-rw-r--r--django/core/urlresolvers.py6
2 files changed, 10 insertions, 2 deletions
diff --git a/django/core/management.py b/django/core/management.py
index a653196679..c910c15589 100644
--- a/django/core/management.py
+++ b/django/core/management.py
@@ -829,6 +829,12 @@ def get_validation_errors(outfile, app=None):
f = opts.get_field(fn)
except models.FieldDoesNotExist:
e.add(opts, '"admin.list_filter" refers to %r, which isn\'t a field.' % fn)
+ # date_hierarchy
+ if opts.admin.date_hierarchy:
+ try:
+ f = opts.get_field(opts.admin.date_hierarchy)
+ except models.FieldDoesNotExist:
+ e.add(opts, '"admin.date_hierarchy" refers to %r, which isn\'t a field.' % opts.admin.date_hierarchy)
# Check ordering attribute.
if opts.ordering:
diff --git a/django/core/urlresolvers.py b/django/core/urlresolvers.py
index f4817dd4c9..1da25c9f83 100644
--- a/django/core/urlresolvers.py
+++ b/django/core/urlresolvers.py
@@ -130,12 +130,13 @@ class RegexURLPattern(object):
return reverse_helper(self.regex, *args, **kwargs)
class RegexURLResolver(object):
- def __init__(self, regex, urlconf_name):
+ def __init__(self, regex, urlconf_name, default_kwargs=None):
# regex is a string representing a regular expression.
# urlconf_name is a string representing the module containing urlconfs.
self.regex = re.compile(regex)
self.urlconf_name = urlconf_name
self.callback = None
+ self.default_kwargs = default_kwargs or {}
def resolve(self, path):
tried = []
@@ -149,7 +150,8 @@ class RegexURLResolver(object):
tried.extend([(pattern.regex.pattern + ' ' + t) for t in e.args[0]['tried']])
else:
if sub_match:
- return sub_match[0], sub_match[1], dict(match.groupdict(), **sub_match[2])
+ sub_match_dict = dict(self.default_kwargs, **sub_match[2])
+ return sub_match[0], sub_match[1], dict(match.groupdict(), **sub_match_dict)
tried.append(pattern.regex.pattern)
raise Resolver404, {'tried': tried, 'path': new_path}