summaryrefslogtreecommitdiff
path: root/django/db/models/__init__.py
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2017-09-02 20:47:47 -0400
committerTim Graham <timograham@gmail.com>2017-09-22 12:51:18 -0400
commit4502489a466b89cccd9d2c1b8d21b2f153d71b4b (patch)
tree1d7c3f1d0c11f981816c6d67e1f3c976013a6ee1 /django/db/models/__init__.py
parent5e31be1b96f60232e1e04140c5f0e33d8c2319f1 (diff)
Refs #18974 -- Removed @models.permalink() decorator per deprecation timeline.
Diffstat (limited to 'django/db/models/__init__.py')
-rw-r--r--django/db/models/__init__.py32
1 files changed, 1 insertions, 31 deletions
diff --git a/django/db/models/__init__.py b/django/db/models/__init__.py
index 628f92db3c..27c67c7fc4 100644
--- a/django/db/models/__init__.py
+++ b/django/db/models/__init__.py
@@ -30,36 +30,6 @@ from django.db.models.fields.related import ( # isort:skip
)
-def permalink(func):
- """
- Decorator that calls urls.reverse() to return a URL using parameters
- returned by the decorated function "func".
-
- "func" should be a function that returns a tuple in one of the
- following formats:
- (viewname, viewargs)
- (viewname, viewargs, viewkwargs)
- """
- import warnings
- from functools import wraps
-
- from django.urls import reverse
- from django.utils.deprecation import RemovedInDjango21Warning
-
- warnings.warn(
- 'permalink() is deprecated in favor of calling django.urls.reverse() '
- 'in the decorated method.',
- RemovedInDjango21Warning,
- stacklevel=2,
- )
-
- @wraps(func)
- def inner(*args, **kwargs):
- bits = func(*args, **kwargs)
- return reverse(bits[0], None, *bits[1:3])
- return inner
-
-
__all__ = aggregates_all + fields_all + indexes_all
__all__ += [
'ObjectDoesNotExist', 'signals',
@@ -72,5 +42,5 @@ __all__ += [
'Prefetch', 'Q', 'QuerySet', 'prefetch_related_objects', 'DEFERRED', 'Model',
'FilteredRelation',
'ForeignKey', 'ForeignObject', 'OneToOneField', 'ManyToManyField',
- 'ManyToOneRel', 'ManyToManyRel', 'OneToOneRel', 'permalink',
+ 'ManyToOneRel', 'ManyToManyRel', 'OneToOneRel',
]