Ticket #12836: fix.diff
File fix.diff, 1.8 KB (added by , 15 years ago) |
---|
-
django/db/models/base.py
15 15 from django.db.models.loading import register_models, get_model 16 16 from django.utils.translation import ugettext_lazy as _ 17 17 import django.utils.copycompat as copy 18 from django.utils.functional import curry 18 from django.utils.functional import curry, wraps 19 19 from django.utils.encoding import smart_str, force_unicode, smart_unicode 20 20 from django.utils.text import get_text_list, capfirst 21 21 from django.conf import settings … … 228 228 cls.__doc__ = "%s(%s)" % (cls.__name__, ", ".join([f.attname for f in opts.fields])) 229 229 230 230 if hasattr(cls, 'get_absolute_url'): 231 cls.get_absolute_url = curry(get_absolute_url, opts, cls.get_absolute_url) 231 cls.get_absolute_url = wraps(cls.get_absolute_url)( 232 curry(get_absolute_url, opts, cls.get_absolute_url) 233 ) 232 234 233 235 signals.class_prepared.send(sender=cls) 234 236 -
django/db/models/__init__.py
12 12 from django.db.models.fields.files import FileField, ImageField 13 13 from django.db.models.fields.related import ForeignKey, OneToOneField, ManyToManyField, ManyToOneRel, ManyToManyRel, OneToOneRel 14 14 from django.db.models import signals 15 from django.utils.functional import wraps 15 16 16 17 # Admin stages. 17 18 ADD, CHANGE, BOTH = 1, 2, 3 … … 27 28 (viewname, viewargs, viewkwargs) 28 29 """ 29 30 from django.core.urlresolvers import reverse 31 @wraps(func) 30 32 def inner(*args, **kwargs): 31 33 bits = func(*args, **kwargs) 32 34 return reverse(bits[0], None, *bits[1:3])