mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #34140 -- Reformatted code blocks in docs with blacken-docs.
This commit is contained in:
committed by
Mariusz Felisiak
parent
6015bab80e
commit
14459f80ee
@@ -401,10 +401,11 @@ To return to the previous rendering (without the ability to clear the
|
||||
from django import forms
|
||||
from myapp.models import Document
|
||||
|
||||
|
||||
class DocumentForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = Document
|
||||
widgets = {'document': forms.FileInput}
|
||||
widgets = {"document": forms.FileInput}
|
||||
|
||||
New index on database session table
|
||||
-----------------------------------
|
||||
@@ -485,6 +486,7 @@ For example with a ``FormSet``:
|
||||
>>> class ArticleForm(Form):
|
||||
... title = CharField()
|
||||
... pub_date = DateField()
|
||||
...
|
||||
>>> ArticleFormSet = formset_factory(ArticleForm)
|
||||
|
||||
the following code will raise a ``ValidationError``:
|
||||
@@ -514,9 +516,9 @@ behavior:
|
||||
|
||||
.. code-block:: pycon
|
||||
|
||||
>>> Template("{{ user.get_full_name }}").render(Context({'user': user}))
|
||||
>>> Template("{{ user.get_full_name }}").render(Context({"user": user}))
|
||||
u'Joe Bloggs'
|
||||
>>> Template("{{ full_name }}").render(Context({'full_name': user.get_full_name}))
|
||||
>>> Template("{{ full_name }}").render(Context({"full_name": user.get_full_name}))
|
||||
u'<bound method User.get_full_name of <...
|
||||
|
||||
This has been resolved in Django 1.3 - the result in both cases will be ``u'Joe
|
||||
@@ -626,7 +628,7 @@ transactions that are being managed using ``commit_manually()``. For example::
|
||||
@transaction.commit_manually
|
||||
def my_view(request, name):
|
||||
obj = get_object_or_404(MyObject, name__iexact=name)
|
||||
return render_to_response('template', {'object':obj})
|
||||
return render_to_response("template", {"object": obj})
|
||||
|
||||
Prior to Django 1.3, this would work without error. However, under
|
||||
Django 1.3, this will raise a
|
||||
|
||||
Reference in New Issue
Block a user