Loading docs/Makefile +1 −1 Original line number Diff line number Diff line Loading @@ -10,7 +10,7 @@ BUILDDIR = _build # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . ALLSPHINXOPTS = -n -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . # the i18n builder cannot share the environment and doctrees with the others I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . Loading docs/faq/usage.txt +5 −4 Original line number Diff line number Diff line Loading @@ -52,10 +52,11 @@ Using a :class:`~django.db.models.FileField` or an #. All that will be stored in your database is a path to the file (relative to :setting:`MEDIA_ROOT`). You'll most likely want to use the convenience :attr:`~django.core.files.File.url` attribute provided by Django. For example, if your :class:`~django.db.models.ImageField` is called ``mug_shot``, you can get the absolute path to your image in a template with ``{{ object.mug_shot.url }}``. convenience :attr:`~django.db.models.fields.files.FieldFile.url` attribute provided by Django. For example, if your :class:`~django.db.models.ImageField` is called ``mug_shot``, you can get the absolute path to your image in a template with ``{{ object.mug_shot.url }}``. How do I make a variable available to all my templates? ------------------------------------------------------- Loading docs/howto/custom-model-fields.txt +9 −9 Original line number Diff line number Diff line Loading @@ -199,20 +199,20 @@ The :meth:`~django.db.models.Field.__init__` method takes the following parameters: * :attr:`~django.db.models.Field.verbose_name` * :attr:`~django.db.models.Field.name` * ``name`` * :attr:`~django.db.models.Field.primary_key` * :attr:`~django.db.models.Field.max_length` * :attr:`~django.db.models.CharField.max_length` * :attr:`~django.db.models.Field.unique` * :attr:`~django.db.models.Field.blank` * :attr:`~django.db.models.Field.null` * :attr:`~django.db.models.Field.db_index` * :attr:`~django.db.models.Field.rel`: Used for related fields (like :class:`ForeignKey`). For advanced use only. * ``rel``: Used for related fields (like :class:`ForeignKey`). For advanced use only. * :attr:`~django.db.models.Field.default` * :attr:`~django.db.models.Field.editable` * :attr:`~django.db.models.Field.serialize`: If ``False``, the field will not be serialized when the model is passed to Django's :doc:`serializers </topics/serialization>`. Defaults to ``True``. * ``serialize``: If ``False``, the field will not be serialized when the model is passed to Django's :doc:`serializers </topics/serialization>`. Defaults to ``True``. * :attr:`~django.db.models.Field.unique_for_date` * :attr:`~django.db.models.Field.unique_for_month` * :attr:`~django.db.models.Field.unique_for_year` Loading @@ -222,7 +222,7 @@ parameters: * :attr:`~django.db.models.Field.db_tablespace`: Only for index creation, if the backend supports :doc:`tablespaces </topics/db/tablespaces>`. You can usually ignore this option. * :attr:`~django.db.models.Field.auto_created`: True if the field was * ``auto_created``: True if the field was automatically created, as for the `OneToOneField` used by model inheritance. For advanced use only. Loading Loading @@ -443,7 +443,7 @@ Python object type we want to store in the model's attribute. If anything is going wrong during value conversion, you should raise a :exc:`~django.core.exceptions.ValidationError` exception. **Remember:** If your custom field needs the :meth:`to_python` method to be **Remember:** If your custom field needs the :meth:`.to_python` method to be called when it is created, you should be using `The SubfieldBase metaclass`_ mentioned earlier. Otherwise :meth:`.to_python` won't be called automatically. Loading docs/howto/custom-template-tags.txt +6 −0 Original line number Diff line number Diff line Loading @@ -114,6 +114,8 @@ your function. Example: Registering custom filters ~~~~~~~~~~~~~~~~~~~~~~~~~~ .. method:: django.template.Library.filter Once you've written your filter definition, you need to register it with your ``Library`` instance, to make it available to Django's template language: Loading Loading @@ -151,6 +153,8 @@ are described in :ref:`filters and auto-escaping <filters-auto-escaping>` and Template filters that expect strings ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. method:: django.template.defaultfilters.stringfilter If you're writing a template filter that only expects a string as the first argument, you should use the decorator ``stringfilter``. This will convert an object to its string value before being passed to your function: Loading Loading @@ -722,6 +726,8 @@ cannot resolve the string passed to it in the current context of the page. Simple tags ~~~~~~~~~~~ .. method:: django.template.Library.simple_tag Many template tags take a number of arguments -- strings or template variables -- and return a string after doing some processing based solely on the input arguments and some external information. For example, the Loading docs/internals/contributing/writing-code/coding-style.txt +3 −3 Original line number Diff line number Diff line Loading @@ -177,9 +177,9 @@ That means that the ability for third parties to import the module at the top level is incompatible with the ability to configure the settings object manually, or makes it very difficult in some circumstances. Instead of the above code, a level of laziness or indirection must be used, such as :class:`django.utils.functional.LazyObject`, :func:`django.utils.functional.lazy` or ``lambda``. Instead of the above code, a level of laziness or indirection must be used, such as ``django.utils.functional.LazyObject``, ``django.utils.functional.lazy()`` or ``lambda``. Miscellaneous ------------- Loading Loading
docs/Makefile +1 −1 Original line number Diff line number Diff line Loading @@ -10,7 +10,7 @@ BUILDDIR = _build # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . ALLSPHINXOPTS = -n -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . # the i18n builder cannot share the environment and doctrees with the others I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . Loading
docs/faq/usage.txt +5 −4 Original line number Diff line number Diff line Loading @@ -52,10 +52,11 @@ Using a :class:`~django.db.models.FileField` or an #. All that will be stored in your database is a path to the file (relative to :setting:`MEDIA_ROOT`). You'll most likely want to use the convenience :attr:`~django.core.files.File.url` attribute provided by Django. For example, if your :class:`~django.db.models.ImageField` is called ``mug_shot``, you can get the absolute path to your image in a template with ``{{ object.mug_shot.url }}``. convenience :attr:`~django.db.models.fields.files.FieldFile.url` attribute provided by Django. For example, if your :class:`~django.db.models.ImageField` is called ``mug_shot``, you can get the absolute path to your image in a template with ``{{ object.mug_shot.url }}``. How do I make a variable available to all my templates? ------------------------------------------------------- Loading
docs/howto/custom-model-fields.txt +9 −9 Original line number Diff line number Diff line Loading @@ -199,20 +199,20 @@ The :meth:`~django.db.models.Field.__init__` method takes the following parameters: * :attr:`~django.db.models.Field.verbose_name` * :attr:`~django.db.models.Field.name` * ``name`` * :attr:`~django.db.models.Field.primary_key` * :attr:`~django.db.models.Field.max_length` * :attr:`~django.db.models.CharField.max_length` * :attr:`~django.db.models.Field.unique` * :attr:`~django.db.models.Field.blank` * :attr:`~django.db.models.Field.null` * :attr:`~django.db.models.Field.db_index` * :attr:`~django.db.models.Field.rel`: Used for related fields (like :class:`ForeignKey`). For advanced use only. * ``rel``: Used for related fields (like :class:`ForeignKey`). For advanced use only. * :attr:`~django.db.models.Field.default` * :attr:`~django.db.models.Field.editable` * :attr:`~django.db.models.Field.serialize`: If ``False``, the field will not be serialized when the model is passed to Django's :doc:`serializers </topics/serialization>`. Defaults to ``True``. * ``serialize``: If ``False``, the field will not be serialized when the model is passed to Django's :doc:`serializers </topics/serialization>`. Defaults to ``True``. * :attr:`~django.db.models.Field.unique_for_date` * :attr:`~django.db.models.Field.unique_for_month` * :attr:`~django.db.models.Field.unique_for_year` Loading @@ -222,7 +222,7 @@ parameters: * :attr:`~django.db.models.Field.db_tablespace`: Only for index creation, if the backend supports :doc:`tablespaces </topics/db/tablespaces>`. You can usually ignore this option. * :attr:`~django.db.models.Field.auto_created`: True if the field was * ``auto_created``: True if the field was automatically created, as for the `OneToOneField` used by model inheritance. For advanced use only. Loading Loading @@ -443,7 +443,7 @@ Python object type we want to store in the model's attribute. If anything is going wrong during value conversion, you should raise a :exc:`~django.core.exceptions.ValidationError` exception. **Remember:** If your custom field needs the :meth:`to_python` method to be **Remember:** If your custom field needs the :meth:`.to_python` method to be called when it is created, you should be using `The SubfieldBase metaclass`_ mentioned earlier. Otherwise :meth:`.to_python` won't be called automatically. Loading
docs/howto/custom-template-tags.txt +6 −0 Original line number Diff line number Diff line Loading @@ -114,6 +114,8 @@ your function. Example: Registering custom filters ~~~~~~~~~~~~~~~~~~~~~~~~~~ .. method:: django.template.Library.filter Once you've written your filter definition, you need to register it with your ``Library`` instance, to make it available to Django's template language: Loading Loading @@ -151,6 +153,8 @@ are described in :ref:`filters and auto-escaping <filters-auto-escaping>` and Template filters that expect strings ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. method:: django.template.defaultfilters.stringfilter If you're writing a template filter that only expects a string as the first argument, you should use the decorator ``stringfilter``. This will convert an object to its string value before being passed to your function: Loading Loading @@ -722,6 +726,8 @@ cannot resolve the string passed to it in the current context of the page. Simple tags ~~~~~~~~~~~ .. method:: django.template.Library.simple_tag Many template tags take a number of arguments -- strings or template variables -- and return a string after doing some processing based solely on the input arguments and some external information. For example, the Loading
docs/internals/contributing/writing-code/coding-style.txt +3 −3 Original line number Diff line number Diff line Loading @@ -177,9 +177,9 @@ That means that the ability for third parties to import the module at the top level is incompatible with the ability to configure the settings object manually, or makes it very difficult in some circumstances. Instead of the above code, a level of laziness or indirection must be used, such as :class:`django.utils.functional.LazyObject`, :func:`django.utils.functional.lazy` or ``lambda``. Instead of the above code, a level of laziness or indirection must be used, such as ``django.utils.functional.LazyObject``, ``django.utils.functional.lazy()`` or ``lambda``. Miscellaneous ------------- Loading