mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #15604 -- Changed django.db.models.permalink to use wraps() so that it doesn't eat the docstring. Thanks for the report, sfllaw. Also added tests.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15798 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
10
tests/regressiontests/model_permalink/models.py
Normal file
10
tests/regressiontests/model_permalink/models.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from django.db import models
|
||||
|
||||
class Guitarist(models.Model):
|
||||
name = models.CharField(max_length=50)
|
||||
slug = models.CharField(max_length=50)
|
||||
|
||||
@models.permalink
|
||||
def url(self):
|
||||
"Returns the URL for this guitarist."
|
||||
return ('guitarist_detail', [self.slug])
|
||||
Reference in New Issue
Block a user