mirror of
https://github.com/django/django.git
synced 2024-12-01 15:42:04 +01:00
Removed Model._meta.get_(add|change|delete)_permission methods per deprecation timeline.
This commit is contained in:
parent
9344bbb446
commit
99339c77f6
@ -455,39 +455,6 @@ class Options(object):
|
|||||||
self._name_map = cache
|
self._name_map = cache
|
||||||
return cache
|
return cache
|
||||||
|
|
||||||
def get_add_permission(self):
|
|
||||||
"""
|
|
||||||
This method has been deprecated in favor of
|
|
||||||
`django.contrib.auth.get_permission_codename`. refs #20642
|
|
||||||
"""
|
|
||||||
warnings.warn(
|
|
||||||
"`Options.get_add_permission` has been deprecated in favor "
|
|
||||||
"of `django.contrib.auth.get_permission_codename`.",
|
|
||||||
RemovedInDjango18Warning, stacklevel=2)
|
|
||||||
return 'add_%s' % self.model_name
|
|
||||||
|
|
||||||
def get_change_permission(self):
|
|
||||||
"""
|
|
||||||
This method has been deprecated in favor of
|
|
||||||
`django.contrib.auth.get_permission_codename`. refs #20642
|
|
||||||
"""
|
|
||||||
warnings.warn(
|
|
||||||
"`Options.get_change_permission` has been deprecated in favor "
|
|
||||||
"of `django.contrib.auth.get_permission_codename`.",
|
|
||||||
RemovedInDjango18Warning, stacklevel=2)
|
|
||||||
return 'change_%s' % self.model_name
|
|
||||||
|
|
||||||
def get_delete_permission(self):
|
|
||||||
"""
|
|
||||||
This method has been deprecated in favor of
|
|
||||||
`django.contrib.auth.get_permission_codename`. refs #20642
|
|
||||||
"""
|
|
||||||
warnings.warn(
|
|
||||||
"`Options.get_delete_permission` has been deprecated in favor "
|
|
||||||
"of `django.contrib.auth.get_permission_codename`.",
|
|
||||||
RemovedInDjango18Warning, stacklevel=2)
|
|
||||||
return 'delete_%s' % self.model_name
|
|
||||||
|
|
||||||
def get_all_related_objects(self, local_only=False, include_hidden=False,
|
def get_all_related_objects(self, local_only=False, include_hidden=False,
|
||||||
include_proxy_eq=False):
|
include_proxy_eq=False):
|
||||||
return [k for k, v in self.get_all_related_objects_with_model(
|
return [k for k, v in self.get_all_related_objects_with_model(
|
||||||
|
Loading…
Reference in New Issue
Block a user