Ticket #2835: 3874-process-remove-kwargs-in-urlconf.diff
File 3874-process-remove-kwargs-in-urlconf.diff, 1.8 KB (added by , 18 years ago) |
---|
-
django/core/urlresolvers.py
160 160 tried.extend([(pattern.regex.pattern + ' ' + t) for t in e.args[0]['tried']]) 161 161 else: 162 162 if sub_match: 163 164 process_kwargs = [] 165 if self.default_kwargs.get('process_kwargs'): 166 process_kwargs = self.default_kwargs['process_kwargs'] 167 del self.default_kwargs['process_kwargs'] 168 169 remove_kwargs = [] 170 if self.default_kwargs.get('remove_kwargs'): 171 remove_kwargs = self.default_kwargs['remove_kwargs'] 172 del self.default_kwargs['remove_kwargs'] 173 163 174 sub_match_dict = dict(self.default_kwargs, **sub_match[2]) 164 return sub_match[0], sub_match[1], dict(match.groupdict(), **sub_match_dict) 175 all_args = [sub_match[0], sub_match[1], dict(match.groupdict(), **sub_match_dict)] 176 177 for key in process_kwargs: 178 if all_args[2].has_key(key): 179 to_call=all_args[2][key] 180 all_args[2] = dict(all_args[2], **to_call(all_args) ) 181 182 for key in remove_kwargs: 183 if all_args[2].has_key(key): 184 del all_args[2][key] 185 186 return all_args 187 165 188 tried.append(pattern.regex.pattern) 166 189 raise Resolver404, {'tried': tried, 'path': new_path} 167 190