Commit 3b89d2d5 authored by Tim Graham's avatar Tim Graham
Browse files

Removed contrib.contenttypes.generic per deprecation timeline; refs #19774.

parent d029fafe
Loading
Loading
Loading
Loading
+0 −21
Original line number Diff line number Diff line
from __future__ import unicode_literals

import warnings

from django.utils.deprecation import RemovedInDjango19Warning

warnings.warn(
    ('django.contrib.contenttypes.generic is deprecated and will be removed in '
     'Django 1.9. Its contents have been moved to the fields, forms, and admin '
     'submodules of django.contrib.contenttypes.'), RemovedInDjango19Warning, stacklevel=2
)

from django.contrib.contenttypes.admin import (  # NOQA
    GenericInlineModelAdmin, GenericStackedInline, GenericTabularInline
)
from django.contrib.contenttypes.fields import (  # NOQA
    GenericForeignKey, GenericRelation
)
from django.contrib.contenttypes.forms import (  # NOQA
    BaseGenericInlineFormSet, generic_inlineformset_factory
)
+0 −25
Original line number Diff line number Diff line
@@ -299,11 +299,6 @@ model:
       is ``True``. This mirrors the ``for_concrete_model`` argument to
       :meth:`~django.contrib.contenttypes.models.ContentTypeManager.get_for_model`.

    .. versionchanged:: 1.7

        This class used to be defined in ``django.contrib.contenttypes.generic``.


.. admonition:: Primary key type compatibility

   The "object_id" field doesn't have to be the same type as the
@@ -369,10 +364,6 @@ Reverse generic relations

.. class:: GenericRelation

    .. versionchanged:: 1.7

        This class used to be defined in ``django.contrib.contenttypes.generic``.

    .. attribute:: related_query_name

        .. versionadded:: 1.7
@@ -496,10 +487,6 @@ The :mod:`django.contrib.contenttypes.forms` module provides:

.. class:: BaseGenericInlineFormSet

    .. versionchanged:: 1.7

        This class used to be defined in ``django.contrib.contenttypes.generic``.

.. function:: generic_inlineformset_factory(model, form=ModelForm, formset=BaseGenericInlineFormSet, ct_field="content_type", fk_field="object_id", fields=None, exclude=None, extra=3, can_order=False, can_delete=True, max_num=None, formfield_callback=None, validate_max=False, for_concrete_model=True, min_num=None, validate_min=False)

    Returns a ``GenericInlineFormSet`` using
@@ -515,10 +502,6 @@ The :mod:`django.contrib.contenttypes.forms` module provides:
    :class:`~django.contrib.contenttypes.fields.GenericForeignKey.for_concrete_model`
    argument on ``GenericForeignKey``.

    .. versionchanged:: 1.7

        This function used to be defined in ``django.contrib.contenttypes.generic``.

    .. versionchanged:: 1.7

        ``min_num`` and ``validate_min`` were added.
@@ -557,16 +540,8 @@ information.
        The name of the integer field that represents the ID of the related
        object. Defaults to ``object_id``.

    .. versionchanged:: 1.7

        This class used to be defined in ``django.contrib.contenttypes.generic``.

.. class:: GenericTabularInline
.. class:: GenericStackedInline

    Subclasses of :class:`GenericInlineModelAdmin` with stacked and tabular
    layouts, respectively.

    .. versionchanged:: 1.7

        These classes used to be defined in ``django.contrib.contenttypes.generic``.