Ticket #4824: defaults.diff
File defaults.diff, 729 bytes (added by , 17 years ago) |
---|
-
django/conf/urls/defaults.py
10 10 11 11 def patterns(prefix, *args): 12 12 pattern_list = [] 13 name_dict = {} 13 14 for t in args: 14 15 if isinstance(t, (list, tuple)): 15 16 t = url(prefix=prefix, *t) 16 17 elif isinstance(t, RegexURLPattern): 17 18 t.add_prefix(prefix) 19 if hasattr(t, 'name') and t.name: 20 if t.name in name_dict: 21 raise ImproperlyConfigured('Duplicate named URL specified ("%s")' % t.name) 22 else: 23 name_dict[t.name] = True 18 24 pattern_list.append(t) 19 25 return pattern_list 20 26