Ticket #26483: 26483-init.diff

File 26483-init.diff, 5.4 KB (added by Tim Graham, 9 years ago)
  • docs/intro/tutorial01.txt

    diff --git a/docs/intro/tutorial01.txt b/docs/intro/tutorial01.txt
    index de86571..5437ea5 100644
    a b These files are:  
    102102  anything inside it (e.g. ``mysite.urls``).
    103103
    104104* :file:`mysite/__init__.py`: An empty file that tells Python that this
    105   directory should be considered a Python package. (Read `more about
    106   packages`_ in the official Python docs if you're a Python beginner.)
     105  directory should be considered a Python package. If you're a Python beginner,
     106  read :ref:`more about packages <tut-packages>` in the official Python docs.
    107107
    108108* :file:`mysite/settings.py`: Settings/configuration for this Django
    109109  project.  :doc:`/topics/settings` will tell you all about how settings
    These files are:  
    116116* :file:`mysite/wsgi.py`: An entry-point for WSGI-compatible web servers to
    117117  serve your project. See :doc:`/howto/deployment/wsgi/index` for more details.
    118118
    119 .. _more about packages: https://docs.python.org/tutorial/modules.html#packages
    120 
    121119The development server
    122120======================
    123121
  • docs/ref/settings.txt

    diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt
    index a244dee..05763cf 100644
    a b Default::  
    924924
    925925A list of formats that will be accepted when inputting data on a date field.
    926926Formats will be tried in order, using the first valid one. Note that these
    927 format strings use Python's datetime_ module syntax, not the format strings
    928 from the ``date`` Django template tag.
     927format strings use Python's :ref:`datetime module syntax
     928<strftime-strptime-behavior>`, not the format strings from the :tfilter:`date`
     929template filter.
    929930
    930931When :setting:`USE_L10N` is ``True``, the locale-dictated format has higher
    931932precedence and will be applied instead.
    932933
    933934See also :setting:`DATETIME_INPUT_FORMATS` and :setting:`TIME_INPUT_FORMATS`.
    934935
    935 .. _datetime: https://docs.python.org/library/datetime.html#strftime-strptime-behavior
    936 
    937936.. setting:: DATETIME_FORMAT
    938937
    939938``DATETIME_FORMAT``
    Default::  
    972971
    973972A list of formats that will be accepted when inputting data on a datetime
    974973field. Formats will be tried in order, using the first valid one. Note that
    975 these format strings use Python's datetime_ module syntax, not the format
    976 strings from the ``date`` Django template tag.
     974these format strings use Python's :ref:`datetime module syntax
     975<strftime-strptime-behavior>`, not the format strings from the :tfilter:`date`
     976template filter.
    977977
    978978When :setting:`USE_L10N` is ``True``, the locale-dictated format has higher
    979979precedence and will be applied instead.
  • docs/ref/utils.txt

    diff --git a/docs/ref/utils.txt b/docs/ref/utils.txt
    index 202cbb4..72bd98d 100644
    a b escaping HTML.  
    619619
    620620.. function:: format_html(format_string, *args, **kwargs)
    621621
    622     This is similar to `str.format`_, except that it is appropriate for
     622    This is similar to :meth:`str.format`, except that it is appropriate for
    623623    building up HTML fragments. All args and kwargs are passed through
    624     :func:`conditional_escape` before being passed to ``str.format``.
     624    :func:`conditional_escape` before being passed to ``str.format()``.
    625625
    626626    For the case of building up small HTML fragments, this function is to be
    627     preferred over string interpolation using ``%`` or ``str.format`` directly,
    628     because it applies escaping to all arguments - just like the Template system
    629     applies escaping by default.
     627    preferred over string interpolation using ``%`` or ``str.format()``
     628    directly, because it applies escaping to all arguments - just like the
     629    template system applies escaping by default.
    630630
    631631    So, instead of writing::
    632632
    633         mark_safe("%s <b>%s</b> %s" % (some_html,
    634                                         escape(some_text),
    635                                         escape(some_other_text),
    636                                         ))
     633        mark_safe("%s <b>%s</b> %s" % (some_html, escape(some_text), escape(some_other_text)))
    637634
    638635    You should instead use::
    639636
    640         format_html("{} <b>{}</b> {}",
    641                     mark_safe(some_html), some_text, some_other_text)
     637        format_html("{} <b>{}</b> {}", mark_safe(some_html), some_text, some_other_text)
    642638
    643639    This has the advantage that you don't need to apply :func:`escape` to each
    644640    argument and risk a bug and an XSS vulnerability if you forget one.
    645641
    646642    Note that although this function uses ``str.format`` to do the
    647     interpolation, some of the formatting options provided by `str.format`_
     643    interpolation, some of the formatting options provided by :meth:`str.format`
    648644    (e.g. number formatting) will not work, since all arguments are passed
    649645    through :func:`conditional_escape` which (ultimately) calls
    650646    :func:`~django.utils.encoding.force_text` on the values.
    651647
    652     .. _str.format: https://docs.python.org/library/stdtypes.html#str.format
    653 
    654648.. function:: format_html_join(sep, format_string, args_generator)
    655649
    656650    A wrapper of :func:`format_html`, for the common case of a group of
    escaping HTML.  
    661655    ``args_generator`` should be an iterator that returns the sequence of
    662656    ``args`` that will be passed to :func:`format_html`. For example::
    663657
    664         format_html_join('\n', "<li>{} {}</li>", ((u.first_name, u.last_name)
    665                                                     for u in users))
     658        format_html_join('\n', "<li>{} {}</li>", ((u.first_name, u.last_name) for u in users))
    666659
    667660.. function:: strip_tags(value)
    668661
Back to Top