Merge remote-tracking branch 'origin/1.1.x'
This commit is contained in:
commit
07556da918
2 changed files with 6 additions and 3 deletions
|
|
@ -205,6 +205,8 @@ You can add variable sections to a URL by marking sections with
|
||||||
as a keyword argument. Optionally, you can use a converter to specify the type
|
as a keyword argument. Optionally, you can use a converter to specify the type
|
||||||
of the argument like ``<converter:variable_name>``. ::
|
of the argument like ``<converter:variable_name>``. ::
|
||||||
|
|
||||||
|
from markupsafe import escape
|
||||||
|
|
||||||
@app.route('/user/<username>')
|
@app.route('/user/<username>')
|
||||||
def show_user_profile(username):
|
def show_user_profile(username):
|
||||||
# show the user profile for that user
|
# show the user profile for that user
|
||||||
|
|
@ -422,7 +424,7 @@ markup to HTML) you can mark it as safe by using the
|
||||||
:class:`~markupsafe.Markup` class or by using the ``|safe`` filter in the
|
:class:`~markupsafe.Markup` class or by using the ``|safe`` filter in the
|
||||||
template. Head over to the Jinja 2 documentation for more examples.
|
template. Head over to the Jinja 2 documentation for more examples.
|
||||||
|
|
||||||
Here is a basic introduction to how the :class:`~jinja2.Markup` class works::
|
Here is a basic introduction to how the :class:`~markupsafe.Markup` class works::
|
||||||
|
|
||||||
>>> from markupsafe import Markup
|
>>> from markupsafe import Markup
|
||||||
>>> Markup('<strong>Hello %s!</strong>') % '<blink>hacker</blink>'
|
>>> Markup('<strong>Hello %s!</strong>') % '<blink>hacker</blink>'
|
||||||
|
|
|
||||||
|
|
@ -256,8 +256,9 @@ exceptions where it is good to know that this object is actually a proxy:
|
||||||
- The proxy objects cannot fake their type as the actual object types.
|
- The proxy objects cannot fake their type as the actual object types.
|
||||||
If you want to perform instance checks, you have to do that on the
|
If you want to perform instance checks, you have to do that on the
|
||||||
object being proxied.
|
object being proxied.
|
||||||
- If the specific object reference is important, for example for
|
- The reference to the proxied object is needed in some situations,
|
||||||
sending :ref:`signals` or passing data to a background thread.
|
such as sending :ref:`signals` or passing data to a background
|
||||||
|
thread.
|
||||||
|
|
||||||
If you need to access the underlying object that is proxied, use the
|
If you need to access the underlying object that is proxied, use the
|
||||||
:meth:`~werkzeug.local.LocalProxy._get_current_object` method::
|
:meth:`~werkzeug.local.LocalProxy._get_current_object` method::
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue