Loading django/contrib/sites/models.py +0 −20 Original line number Diff line number Diff line from __future__ import unicode_literals import string import warnings from django.core.exceptions import ImproperlyConfigured, ValidationError from django.db import models from django.db.models.signals import pre_save, pre_delete from django.utils.deprecation import RemovedInDjango19Warning from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ from .requests import RequestSite as RealRequestSite from .shortcuts import get_current_site as real_get_current_site SITE_CACHE = {} Loading Loading @@ -93,21 +88,6 @@ class Site(models.Model): return self.domain class RequestSite(RealRequestSite): def __init__(self, *args, **kwargs): warnings.warn( "Please import RequestSite from django.contrib.sites.requests.", RemovedInDjango19Warning, stacklevel=2) super(RequestSite, self).__init__(*args, **kwargs) def get_current_site(request): warnings.warn( "Please import get_current_site from django.contrib.sites.shortcuts.", RemovedInDjango19Warning, stacklevel=2) return real_get_current_site(request) def clear_site_cache(sender, **kwargs): """ Clears the cache (if primed) each time a site is saved or deleted Loading docs/ref/contrib/sites.txt +0 −10 Original line number Diff line number Diff line Loading @@ -472,11 +472,6 @@ a fallback when the database-backed sites framework is not available. Sets the ``name`` and ``domain`` attributes to the value of :meth:`~django.http.HttpRequest.get_host`. .. deprecated:: 1.7 This class used to be defined in ``django.contrib.sites.models``. The old import location will work until Django 1.9. A :class:`~django.contrib.sites.requests.RequestSite` object has a similar interface to a normal :class:`~django.contrib.sites.models.Site` object, except its :meth:`~django.contrib.sites.requests.RequestSite.__init__()` Loading @@ -499,11 +494,6 @@ Finally, to avoid repetitive fallback code, the framework provides a object or a :class:`~django.contrib.sites.requests.RequestSite` object based on the request. .. deprecated:: 1.7 This function used to be defined in ``django.contrib.sites.models``. The old import location will work until Django 1.9. .. versionchanged:: 1.8 This function will now lookup the current site based on Loading Loading
django/contrib/sites/models.py +0 −20 Original line number Diff line number Diff line from __future__ import unicode_literals import string import warnings from django.core.exceptions import ImproperlyConfigured, ValidationError from django.db import models from django.db.models.signals import pre_save, pre_delete from django.utils.deprecation import RemovedInDjango19Warning from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ from .requests import RequestSite as RealRequestSite from .shortcuts import get_current_site as real_get_current_site SITE_CACHE = {} Loading Loading @@ -93,21 +88,6 @@ class Site(models.Model): return self.domain class RequestSite(RealRequestSite): def __init__(self, *args, **kwargs): warnings.warn( "Please import RequestSite from django.contrib.sites.requests.", RemovedInDjango19Warning, stacklevel=2) super(RequestSite, self).__init__(*args, **kwargs) def get_current_site(request): warnings.warn( "Please import get_current_site from django.contrib.sites.shortcuts.", RemovedInDjango19Warning, stacklevel=2) return real_get_current_site(request) def clear_site_cache(sender, **kwargs): """ Clears the cache (if primed) each time a site is saved or deleted Loading
docs/ref/contrib/sites.txt +0 −10 Original line number Diff line number Diff line Loading @@ -472,11 +472,6 @@ a fallback when the database-backed sites framework is not available. Sets the ``name`` and ``domain`` attributes to the value of :meth:`~django.http.HttpRequest.get_host`. .. deprecated:: 1.7 This class used to be defined in ``django.contrib.sites.models``. The old import location will work until Django 1.9. A :class:`~django.contrib.sites.requests.RequestSite` object has a similar interface to a normal :class:`~django.contrib.sites.models.Site` object, except its :meth:`~django.contrib.sites.requests.RequestSite.__init__()` Loading @@ -499,11 +494,6 @@ Finally, to avoid repetitive fallback code, the framework provides a object or a :class:`~django.contrib.sites.requests.RequestSite` object based on the request. .. deprecated:: 1.7 This function used to be defined in ``django.contrib.sites.models``. The old import location will work until Django 1.9. .. versionchanged:: 1.8 This function will now lookup the current site based on Loading