mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Removed versionadded/changed notes for 1.7.
This commit is contained in:
@@ -102,8 +102,6 @@ The register decorator
|
||||
|
||||
.. function:: register(*models, [site=django.admin.sites.site])
|
||||
|
||||
.. versionadded:: 1.7
|
||||
|
||||
There is also a decorator for registering your ``ModelAdmin`` classes::
|
||||
|
||||
from django.contrib import admin
|
||||
@@ -134,15 +132,11 @@ application and imports it.
|
||||
|
||||
.. class:: apps.AdminConfig
|
||||
|
||||
.. versionadded:: 1.7
|
||||
|
||||
This is the default :class:`~django.apps.AppConfig` class for the admin.
|
||||
It calls :func:`~django.contrib.admin.autodiscover()` when Django starts.
|
||||
|
||||
.. class:: apps.SimpleAdminConfig
|
||||
|
||||
.. versionadded:: 1.7
|
||||
|
||||
This class works like :class:`~django.contrib.admin.apps.AdminConfig`,
|
||||
except it doesn't call :func:`~django.contrib.admin.autodiscover()`.
|
||||
|
||||
@@ -151,12 +145,8 @@ application and imports it.
|
||||
This function attempts to import an ``admin`` module in each installed
|
||||
application. Such modules are expected to register models with the admin.
|
||||
|
||||
.. versionchanged:: 1.7
|
||||
|
||||
Previous versions of Django recommended calling this function directly
|
||||
in the URLconf. As of Django 1.7 this isn't needed anymore.
|
||||
:class:`~django.contrib.admin.apps.AdminConfig` takes care of running
|
||||
the auto-discovery automatically.
|
||||
Typically you won't need to call this function directly as
|
||||
:class:`~django.contrib.admin.apps.AdminConfig` calls it when Django starts.
|
||||
|
||||
If you are using a custom ``AdminSite``, it is common to import all of the
|
||||
``ModelAdmin`` subclasses into your code and register them to the custom
|
||||
@@ -164,14 +154,6 @@ If you are using a custom ``AdminSite``, it is common to import all of the
|
||||
put ``'django.contrib.admin.apps.SimpleAdminConfig'`` instead of
|
||||
``'django.contrib.admin'`` in your :setting:`INSTALLED_APPS` setting.
|
||||
|
||||
.. versionchanged:: 1.7
|
||||
|
||||
In previous versions, the admin needed to be instructed to look for
|
||||
``admin.py`` files with :func:`~django.contrib.admin.autodiscover()`.
|
||||
As of Django 1.7, auto-discovery is enabled by default and must be
|
||||
explicitly disabled when it's undesirable.
|
||||
|
||||
|
||||
``ModelAdmin`` options
|
||||
----------------------
|
||||
|
||||
@@ -661,8 +643,6 @@ subclass::
|
||||
The above will tell Django to order by the ``first_name`` field when
|
||||
trying to sort by ``colored_first_name`` in the admin.
|
||||
|
||||
.. versionadded:: 1.7
|
||||
|
||||
To indicate descending order with ``admin_order_field`` you can use a
|
||||
hyphen prefix on the field name. Using the above example, this would
|
||||
look like::
|
||||
@@ -737,10 +717,6 @@ subclass::
|
||||
list_display = ('timestamp', 'message')
|
||||
list_display_links = None
|
||||
|
||||
.. versionchanged:: 1.7
|
||||
|
||||
``None`` was added as a valid ``list_display_links`` value.
|
||||
|
||||
.. _admin-list-editable:
|
||||
|
||||
.. attribute:: ModelAdmin.list_editable
|
||||
@@ -1176,8 +1152,6 @@ subclass::
|
||||
|
||||
.. attribute:: ModelAdmin.view_on_site
|
||||
|
||||
.. versionadded:: 1.7
|
||||
|
||||
Set ``view_on_site`` to control whether or not to display the "View on site" link.
|
||||
This link should bring you to a URL where you can display the saved object.
|
||||
|
||||
@@ -1373,14 +1347,8 @@ templates used by the :class:`ModelAdmin` views:
|
||||
names on the changelist that will be linked to the change view, as described
|
||||
in the :attr:`ModelAdmin.list_display_links` section.
|
||||
|
||||
.. versionchanged:: 1.7
|
||||
|
||||
``None`` was added as a valid ``get_list_display_links()`` return value.
|
||||
|
||||
.. method:: ModelAdmin.get_fields(request, obj=None)
|
||||
|
||||
.. versionadded:: 1.7
|
||||
|
||||
The ``get_fields`` method is given the ``HttpRequest`` and the ``obj``
|
||||
being edited (or ``None`` on an add form) and is expected to return a list
|
||||
of fields, as described above in the :attr:`ModelAdmin.fields` section.
|
||||
@@ -1400,8 +1368,6 @@ templates used by the :class:`ModelAdmin` views:
|
||||
|
||||
.. method:: ModelAdmin.get_search_fields(request)
|
||||
|
||||
.. versionadded:: 1.7
|
||||
|
||||
The ``get_search_fields`` method is given the ``HttpRequest`` and is expected
|
||||
to return the same kind of sequence type as for the
|
||||
:attr:`~ModelAdmin.search_fields` attribute.
|
||||
@@ -1723,8 +1689,6 @@ templates used by the :class:`ModelAdmin` views:
|
||||
|
||||
.. method:: ModelAdmin.response_delete(request, obj_display, obj_id)
|
||||
|
||||
.. versionadded:: 1.7
|
||||
|
||||
Determines the :class:`~django.http.HttpResponse` for the
|
||||
:meth:`delete_view` stage.
|
||||
|
||||
@@ -1744,8 +1708,6 @@ templates used by the :class:`ModelAdmin` views:
|
||||
|
||||
.. method:: ModelAdmin.get_changeform_initial_data(request)
|
||||
|
||||
.. versionadded:: 1.7
|
||||
|
||||
A hook for the initial data on admin change forms. By default, fields are
|
||||
given initial values from ``GET`` parameters. For instance,
|
||||
``?name=initial_value`` will set the ``name`` field's initial value to be
|
||||
@@ -2021,8 +1983,6 @@ The ``InlineModelAdmin`` class adds:
|
||||
|
||||
.. attribute:: InlineModelAdmin.min_num
|
||||
|
||||
.. versionadded:: 1.7
|
||||
|
||||
This controls the minimum number of forms to show in the inline.
|
||||
See :func:`~django.forms.models.modelformset_factory` for more information.
|
||||
|
||||
@@ -2114,8 +2074,6 @@ The ``InlineModelAdmin`` class adds:
|
||||
|
||||
.. method:: InlineModelAdmin.get_min_num(request, obj=None, **kwargs)
|
||||
|
||||
.. versionadded:: 1.7
|
||||
|
||||
Returns the minimum number of inline forms to use. By default,
|
||||
returns the :attr:`InlineModelAdmin.min_num` attribute.
|
||||
|
||||
@@ -2451,15 +2409,11 @@ Templates can override or extend base admin templates as described in
|
||||
|
||||
.. attribute:: AdminSite.site_header
|
||||
|
||||
.. versionadded:: 1.7
|
||||
|
||||
The text to put at the top of each admin page, as an ``<h1>`` (a string).
|
||||
By default, this is "Django administration".
|
||||
|
||||
.. attribute:: AdminSite.site_title
|
||||
|
||||
.. versionadded:: 1.7
|
||||
|
||||
The text to put at the end of each admin page's ``<title>`` (a string). By
|
||||
default, this is "Django site admin".
|
||||
|
||||
@@ -2472,8 +2426,6 @@ Templates can override or extend base admin templates as described in
|
||||
|
||||
.. attribute:: AdminSite.index_title
|
||||
|
||||
.. versionadded:: 1.7
|
||||
|
||||
The text to put at the top of the admin index page (a string). By default,
|
||||
this is "Site administration".
|
||||
|
||||
@@ -2514,8 +2466,6 @@ Templates can override or extend base admin templates as described in
|
||||
|
||||
.. method:: AdminSite.each_context(request)
|
||||
|
||||
.. versionadded:: 1.7
|
||||
|
||||
Returns a dictionary of variables to put in the template context for
|
||||
every page in the admin site.
|
||||
|
||||
|
||||
@@ -215,12 +215,8 @@ Methods
|
||||
.. method:: email_user(subject, message, from_email=None, **kwargs)
|
||||
|
||||
Sends an email to the user. If ``from_email`` is ``None``, Django uses
|
||||
the :setting:`DEFAULT_FROM_EMAIL`.
|
||||
|
||||
.. versionchanged:: 1.7
|
||||
|
||||
Any ``**kwargs`` are passed to the underlying
|
||||
:meth:`~django.core.mail.send_mail()` call.
|
||||
the :setting:`DEFAULT_FROM_EMAIL`. Any ``**kwargs`` are passed to the
|
||||
underlying :meth:`~django.core.mail.send_mail()` call.
|
||||
|
||||
Manager methods
|
||||
---------------
|
||||
|
||||
@@ -366,8 +366,6 @@ Reverse generic relations
|
||||
|
||||
.. attribute:: related_query_name
|
||||
|
||||
.. versionadded:: 1.7
|
||||
|
||||
The relation on the related object back to this object doesn't exist by
|
||||
default. Setting ``related_query_name`` creates a relation from the
|
||||
related object back to this one. This allows querying and filtering
|
||||
@@ -392,8 +390,6 @@ be used to retrieve their associated ``TaggedItems``::
|
||||
>>> b.tags.all()
|
||||
[<TaggedItem: django>, <TaggedItem: python>]
|
||||
|
||||
.. versionadded:: 1.7
|
||||
|
||||
Defining :class:`~django.contrib.contenttypes.fields.GenericRelation` with
|
||||
``related_query_name`` set allows querying from the related object::
|
||||
|
||||
@@ -502,15 +498,10 @@ The :mod:`django.contrib.contenttypes.forms` module provides:
|
||||
:class:`~django.contrib.contenttypes.fields.GenericForeignKey.for_concrete_model`
|
||||
argument on ``GenericForeignKey``.
|
||||
|
||||
.. versionchanged:: 1.7
|
||||
|
||||
``min_num`` and ``validate_min`` were added.
|
||||
|
||||
|
||||
.. module:: django.contrib.contenttypes.admin
|
||||
|
||||
Generic relations in admin
|
||||
------------------------------------
|
||||
--------------------------
|
||||
|
||||
The :mod:`django.contrib.contenttypes.admin` module provides
|
||||
:class:`~django.contrib.contenttypes.admin.GenericTabularInline` and
|
||||
|
||||
@@ -737,16 +737,12 @@ For example::
|
||||
|
||||
.. method:: crosses(other)
|
||||
|
||||
.. versionadded:: 1.7
|
||||
|
||||
.. note::
|
||||
|
||||
GEOS 3.3 is *required* to use this predicate.
|
||||
|
||||
.. method:: disjoint(other)
|
||||
|
||||
.. versionadded:: 1.7
|
||||
|
||||
.. note::
|
||||
|
||||
GEOS 3.3 is *required* to use this predicate.
|
||||
@@ -755,24 +751,18 @@ For example::
|
||||
|
||||
.. method:: overlaps(other)
|
||||
|
||||
.. versionadded:: 1.7
|
||||
|
||||
.. note::
|
||||
|
||||
GEOS 3.3 is *required* to use this predicate.
|
||||
|
||||
.. method:: touches(other)
|
||||
|
||||
.. versionadded:: 1.7
|
||||
|
||||
.. note::
|
||||
|
||||
GEOS 3.3 is *required* to use this predicate.
|
||||
|
||||
.. method:: within(other)
|
||||
|
||||
.. versionadded:: 1.7
|
||||
|
||||
.. note::
|
||||
|
||||
GEOS 3.3 is *required* to use this predicate.
|
||||
|
||||
@@ -198,8 +198,6 @@ Even if you know there is only just one message, you should still iterate over
|
||||
the ``messages`` sequence, because otherwise the message storage will not be cleared
|
||||
for the next request.
|
||||
|
||||
.. versionadded:: 1.7
|
||||
|
||||
The context processor also provides a ``DEFAULT_MESSAGE_LEVELS`` variable which
|
||||
is a mapping of the message level names to their numeric value::
|
||||
|
||||
@@ -214,8 +212,6 @@ is a mapping of the message level names to their numeric value::
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
|
||||
|
||||
**Outside of templates**, you can use
|
||||
:func:`~django.contrib.messages.get_messages`::
|
||||
|
||||
@@ -253,8 +249,6 @@ The ``Message`` class
|
||||
* ``extra_tags``: A string containing custom tags for this message,
|
||||
separated by spaces. It's empty by default.
|
||||
|
||||
.. versionadded:: 1.7
|
||||
|
||||
* ``level_tag``: The string representation of the level. By default, it's
|
||||
the lowercase version of the name of the associated constant, but this
|
||||
can be changed if you need by using the :setting:`MESSAGE_TAGS` setting.
|
||||
@@ -438,8 +432,6 @@ behavior:
|
||||
* :setting:`MESSAGE_STORAGE`
|
||||
* :setting:`MESSAGE_TAGS`
|
||||
|
||||
.. versionadded:: 1.7
|
||||
|
||||
For backends that use cookies, the settings for the cookie are taken from
|
||||
the session cookie settings:
|
||||
|
||||
|
||||
@@ -89,20 +89,14 @@ Middleware
|
||||
|
||||
.. attribute:: response_gone_class
|
||||
|
||||
.. versionadded:: 1.7
|
||||
|
||||
The :class:`~django.http.HttpResponse` class used when a
|
||||
:class:`~django.contrib.redirects.models.Redirect` is not
|
||||
found for the requested path or has a blank ``new_path``
|
||||
value.
|
||||
:class:`~django.contrib.redirects.models.Redirect` is not found for the
|
||||
requested path or has a blank ``new_path`` value.
|
||||
|
||||
Defaults to :class:`~django.http.HttpResponseGone`.
|
||||
|
||||
.. attribute:: response_redirect_class
|
||||
|
||||
.. versionadded:: 1.7
|
||||
|
||||
The :class:`~django.http.HttpResponse` class that handles the
|
||||
redirect.
|
||||
The :class:`~django.http.HttpResponse` class that handles the redirect.
|
||||
|
||||
Defaults to :class:`~django.http.HttpResponsePermanentRedirect`.
|
||||
|
||||
@@ -181,8 +181,6 @@ Sitemap class reference
|
||||
representing the last-modified date/time for *every* object returned by
|
||||
:attr:`~Sitemap.items()`.
|
||||
|
||||
.. versionadded:: 1.7
|
||||
|
||||
If all items in a sitemap have a :attr:`~Sitemap.lastmod`, the sitemap
|
||||
generated by :func:`views.sitemap` will have a ``Last-Modified``
|
||||
header equal to the latest ``lastmod``. You can activate the
|
||||
|
||||
@@ -389,8 +389,6 @@ define :class:`~django.contrib.sites.managers.CurrentSiteManager`.
|
||||
Site middleware
|
||||
===============
|
||||
|
||||
.. versionadded:: 1.7
|
||||
|
||||
If you often use this pattern::
|
||||
|
||||
from django.contrib.sites.models import Site
|
||||
|
||||
@@ -78,13 +78,6 @@ respectively. For example::
|
||||
Then set the :setting:`STATICFILES_STORAGE` setting to
|
||||
``'path.to.MyStaticFilesStorage'``.
|
||||
|
||||
.. versionadded:: 1.7
|
||||
|
||||
The ability to override ``file_permissions_mode`` and
|
||||
``directory_permissions_mode`` is new in Django 1.7. Previously the file
|
||||
permissions always used :setting:`FILE_UPLOAD_PERMISSIONS` and the directory
|
||||
permissions always used :setting:`FILE_UPLOAD_DIRECTORY_PERMISSIONS`.
|
||||
|
||||
.. highlight:: console
|
||||
|
||||
Some commonly used options are:
|
||||
@@ -174,10 +167,6 @@ get all the directories which were searched::
|
||||
/home/polls.com/core/static
|
||||
/some/other/path/static
|
||||
|
||||
.. versionadded:: 1.7
|
||||
|
||||
The additional output of which directories were searched was added.
|
||||
|
||||
.. _staticfiles-runserver:
|
||||
|
||||
runserver
|
||||
@@ -244,8 +233,6 @@ counterparts and update the cache appropriately.
|
||||
ManifestStaticFilesStorage
|
||||
--------------------------
|
||||
|
||||
.. versionadded:: 1.7
|
||||
|
||||
.. class:: storage.ManifestStaticFilesStorage
|
||||
|
||||
A subclass of the :class:`~django.contrib.staticfiles.storage.StaticFilesStorage`
|
||||
@@ -370,10 +357,6 @@ of directory paths in which the finders searched. Example usage::
|
||||
result = finders.find('css/base.css')
|
||||
searched_locations = finders.searched_locations
|
||||
|
||||
.. versionadded:: 1.7
|
||||
|
||||
The ``searched_locations`` attribute was added.
|
||||
|
||||
Other Helpers
|
||||
=============
|
||||
|
||||
@@ -423,12 +406,6 @@ This view function serves static files in development.
|
||||
**insecure**. This is only intended for local development, and should
|
||||
**never be used in production**.
|
||||
|
||||
.. versionchanged:: 1.7
|
||||
|
||||
This view will now raise an :exc:`~django.http.Http404` exception instead
|
||||
of :exc:`~django.core.exceptions.ImproperlyConfigured` when
|
||||
:setting:`DEBUG` is ``False``.
|
||||
|
||||
.. note::
|
||||
|
||||
To guess the served files' content types, this view relies on the
|
||||
@@ -502,8 +479,3 @@ But given the fact that it makes use of the
|
||||
transparently overlay at test execution-time the assets provided by the
|
||||
``staticfiles`` finders. This means you don't need to run
|
||||
:djadmin:`collectstatic` before or as a part of your tests setup.
|
||||
|
||||
.. versionadded:: 1.7
|
||||
|
||||
``StaticLiveServerTestCase`` is new in Django 1.7. Previously its
|
||||
functionality was provided by :class:`django.test.LiveServerTestCase`.
|
||||
|
||||
@@ -954,10 +954,6 @@ They share this interface:
|
||||
:class:`django.utils.feedgenerator.Enclosure`.
|
||||
* ``categories`` should be a sequence of Unicode objects.
|
||||
|
||||
.. versionadded:: 1.7
|
||||
|
||||
The optional ``updateddate`` argument was added.
|
||||
|
||||
:meth:`.SyndicationFeed.write`
|
||||
Outputs the feed in the given encoding to outfile, which is a file-like object.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user