Ticket #8979: doc-fixes-r8985.diff

File doc-fixes-r8985.diff, 12.7 KB (added by Ramiro Morales, 16 years ago)
  • docs/ref/contrib/admin.txt

    diff -r 07be6b6eaea0 docs/ref/contrib/admin.txt
    a b To continue the example above, we want t  
    924924To continue the example above, we want to add a new link next to the ``History``
    925925tool for the ``Page`` model. After looking at ``change_form.html`` we determine
    926926that we only need to override the ``object-tools`` block. Therefore here is our
    927 new ``change_form.html`` ::
     927new ``change_form.html`` :
     928
     929.. code-block:: html+django
    928930
    929931    {% extends "admin/change_form.html" %}
    930932    {% load i18n %}
  • docs/ref/contrib/comments/index.txt

    diff -r 07be6b6eaea0 docs/ref/contrib/comments/index.txt
    a b Django's comments framework  
    66
    77.. module:: django.contrib.comments
    88   :synopsis: Django's comment framework
     9
     10.. highlightlang:: html+django
    911
    1012Django includes a simple, yet customizable comments framework. The built-in
    1113comments framework can be used to attach comments to any model, so you can use
  • docs/ref/contrib/formtools/form-wizard.txt

    diff -r 07be6b6eaea0 docs/ref/contrib/formtools/form-wizard.txt
    a b You can specify it in two ways:  
    169169    * Pass :attr:`~django.contrib.formtools.wizard.FormWizard.extra_context`
    170170      as extra parameters in the URLconf.
    171171
    172 Here's a full example template::
    173  
     172Here's a full example template:
     173
     174.. code-block:: html+django
     175
    174176    {% extends "base.html" %}
    175177
    176178    {% block content %}
  • docs/ref/django-admin.txt

    diff -r 07be6b6eaea0 docs/ref/django-admin.txt
    a b makemessages  
    385385------------
    386386
    387387.. versionchanged:: 1.0
    388    Before 1.0 this was the "bin/make-messages.py" command.
     388   Before 1.0 this was the ``bin/make-messages.py`` command.
    389389
    390390Runs over the entire source tree of the current directory and pulls out all
    391391strings marked for translation. It creates (or updates) a message file in the
  • docs/ref/files/file.txt

    diff -r 07be6b6eaea0 docs/ref/files/file.txt
    a b Additional ``ImageField`` attributes  
    8888
    8989.. attribute:: File.height
    9090
    91     Heigght of the image.
     91    Height of the image.
    9292
    9393Additional methods on files attached to objects
    9494-----------------------------------------------
  • docs/ref/request-response.txt

    diff -r 07be6b6eaea0 docs/ref/request-response.txt
    a b All attributes except ``session`` should  
    9393    A standard Python dictionary containing all cookies. Keys and values are
    9494    strings.
    9595
    96 .. attribute:: HttpRequest.FILES
    97 
    98     .. admonition:: Changed in Django development version
    99        
    100         In previous versions of Django, ``request.FILES`` contained
    101         simple ``dict`` objects representing uploaded files. This is
    102         no longer true -- files are represented by ``UploadedFile``
    103         objects as described below.
    104        
    105         These ``UploadedFile`` objects will emulate the old-style ``dict``
    106         interface, but this is deprecated and will be removed in the next
    107         release of Django.
     96.. attribute:: HttpRequest.FILES
    10897
    10998    A dictionary-like object containing all uploaded files. Each key in
    11099    ``FILES`` is the ``name`` from the ``<input type="file" name="" />``. Each
    All attributes except ``session`` should  
    122111    and the ``<form>`` that posted to the request had
    123112    ``enctype="multipart/form-data"``. Otherwise, ``FILES`` will be a blank
    124113    dictionary-like object.
     114
     115    .. versionchanged:: 1.0
     116
     117    In previous versions of Django, ``request.FILES`` contained simple ``dict``
     118    objects representing uploaded files. This is no longer true -- files are
     119    represented by ``UploadedFile`` objects as described below.
     120
     121    These ``UploadedFile`` objects will emulate the old-style ``dict``
     122    interface, but this is deprecated and will be removed in the next release of
     123    Django.
    125124
    126125.. attribute:: HttpRequest.META
    127126
  • docs/ref/templates/api.txt

    diff -r 07be6b6eaea0 docs/ref/templates/api.txt
    a b content from a database or enable access  
    2929
    3030Block tags are surrounded by ``"{%"`` and ``"%}"``.
    3131
    32 Example template with block tags::
     32Example template with block tags:
     33
     34.. code-block:: html+django
    3335
    3436    {% if is_logged_in %}Thanks for logging in!{% else %}Please log in.{% endif %}
    3537
    A **variable** is a symbol within a temp  
    3739
    3840Variable tags are surrounded by ``"{{"`` and ``"}}"``.
    3941
    40 Example template with variables::
     42Example template with variables:
     43
     44.. code-block:: html+django
    4145
    4246    My first name is {{ first_name }}. My last name is {{ last_name }}.
    4347
    returns the resulting string::  
    566570
    567571The ``render_to_string`` shortcut takes one required argument --
    568572``template_name``, which should be the name of the template to load
    569 and render -- and two optional arguments::
     573and render -- and two optional arguments:
    570574
    571575    dictionary
    572576        A dictionary to be used as variables and values for the
  • docs/ref/templates/builtins.txt

    diff -r 07be6b6eaea0 docs/ref/templates/builtins.txt
    a b documentation for any custom tags or fil  
    1313
    1414Built-in tag reference
    1515----------------------
     16
     17.. highlightlang:: html+django
    1618
    1719.. templatetag:: autoescape
    1820
    Regroup a list of alike objects by a com  
    473475
    474476This complex tag is best illustrated by use of an example: say that ``people``
    475477is a list of people represented by dictionaries with ``first_name``,
    476 ``last_name``, and ``gender`` keys::
     478``last_name``, and ``gender`` keys:
     479
     480.. code-block:: python
    477481
    478482    people = [
    479483        {'first_name': 'George', 'last_name': 'Bush', 'gender': 'Male'},
    If the ``people`` list did *not* order i  
    530534If the ``people`` list did *not* order its members by ``gender``, the regrouping
    531535would naively display more than one group for a single gender. For example,
    532536say the ``people`` list was set to this (note that the males are not grouped
    533 together)::
     537together):
     538
     539.. code-block:: python
    534540
    535541    people = [
    536542        {'first_name': 'Bill', 'last_name': 'Clinton', 'gender': 'Male'},
    arguments in the URL. All arguments requ  
    657663
    658664For example, suppose you have a view, ``app_views.client``, whose URLconf
    659665takes a client ID (here, ``client()`` is a method inside the views file
    660 ``app_views.py``). The URLconf line might look like this::
     666``app_views.py``). The URLconf line might look like this:
     667
     668.. code-block:: python
    661669
    662670    ('^client/(\d+)/$', 'app_views.client')
    663671
    664672If this app's URLconf is included into the project's URLconf under a path
    665 such as this::
     673such as this:
     674
     675.. code-block:: python
    666676
    667677    ('^clients/', include('project_name.app_name.urls'))
    668678
    Note that if the URL you're reversing do  
    682692:exc:`NoReverseMatch` exception raised, which will cause your site to display an
    683693error page.
    684694
    685 **New in development verson:** If you'd like to retrieve a URL without displaying it,
    686 you can use a slightly different call:
     695.. versionadded:: 1.0
    687696
    688 .. code-block:: html+django
     697If you'd like to retrieve a URL without displaying it, you can use a slightly
     698different call::
     699
    689700
    690701    {% url path.to.view arg, arg2 as the_url %}
    691702   
    692703    <a href="{{ the_url }}">I'm linking to {{ the_url }}</a>
    693704   
    694705This ``{% url ... as var %}`` syntax will *not* cause an error if the view is
    695 missing. In practice you'll use this to link to views that are optional:
    696 
    697 .. code-block:: html+django
     706missing. In practice you'll use this to link to views that are optional::
    698707
    699708    {% url path.to.view as the_url %}
    700709    {% if the_url %}
    For example::  
    845854
    846855    {{ value|dictsort:"name" }}
    847856
    848 If ``value`` is::
     857If ``value`` is:
     858
     859.. code-block:: python
    849860
    850861    [
    851862        {'name': 'zed', 'age': 19},
    If ``value`` is::  
    853864        {'name': 'joe', 'age': 31},
    854865    ]
    855866
    856 then the output would be::
     867then the output would be:
     868
     869.. code-block:: python
    857870
    858871    [
    859872        {'name': 'amy', 'age': 22},
    http://diveintopython.org/native_data_ty  
    12741287http://diveintopython.org/native_data_types/lists.html#odbchelper.list.slice
    12751288for an introduction.
    12761289
    1277 Example: ``{{ some_list|slice:":2" }}``
     1290Example::
     1291
     1292    {{ some_list|slice:":2" }}
    12781293
    12791294.. templatefilter:: slugify
    12801295
  • docs/topics/forms/formsets.txt

    diff -r 07be6b6eaea0 docs/topics/forms/formsets.txt
    a b management form inside the template. Let  
    306306            formset = ArticleFormSet()
    307307        return render_to_response('manage_articles.html', {'formset': formset})
    308308
    309 The ``manage_articles.html`` template might look like this::
     309The ``manage_articles.html`` template might look like this:
     310
     311.. code-block:: html+django
    310312
    311313    <form method="POST" action="">
    312314        {{ formset.management_form }}
    The ``manage_articles.html`` template mi  
    318320    </form>
    319321
    320322However the above can be slightly shortcutted and let the formset itself deal
    321 with the management form::
     323with the management form:
     324
     325.. code-block:: html+django
    322326
    323327    <form method="POST" action="">
    324328        <table>
  • docs/topics/forms/index.txt

    diff -r 07be6b6eaea0 docs/topics/forms/index.txt
    a b Working with forms  
    99    This document provides an introduction to Django's form handling features.
    1010    For a more detailed look at the forms API, see :ref:`ref-forms-api`. For
    1111    documentation of the available field types, see :ref:`ref-forms-fields`.
     12
     13.. highlightlang:: html+django
    1214
    1315``django.forms`` is Django's form-handling library.
    1416
    Django's database models.  
    6062Django's database models.
    6163
    6264For example, consider a form used to implement "contact me" functionality on a
    63 personal Web site::
     65personal Web site:
     66
     67.. code-block:: python
    6468
    6569    from django import forms
    6670
    Using a form in a view  
    8286Using a form in a view
    8387----------------------
    8488
    85 The standard pattern for processing a form in a view looks like this::
     89The standard pattern for processing a form in a view looks like this:
     90
     91.. code-block:: python
    8692
    8793   def contact(request):
    8894       if request.method == 'POST': # If the form has been submitted...
    also be converted in to the relevant Pyt  
    133139``cc_myself`` will be a boolean value. Likewise, fields such as ``IntegerField``
    134140and ``FloatField`` convert values to a Python int and float respectively.
    135141
    136 Extending the above example, here's how the form data could be processed::
     142Extending the above example, here's how the form data could be processed:
     143
     144.. code-block:: python
    137145
    138146    if form.is_valid():
    139147        subject = form.cleaned_data['subject']
  • docs/topics/http/sessions.txt

    diff -r 07be6b6eaea0 docs/topics/http/sessions.txt
    a b Configuring the session engine  
    3636Configuring the session engine
    3737==============================
    3838
    39 .. versionadded:: 1.0.
     39.. versionadded:: 1.0
    4040
    4141By default, Django stores sessions in your database (using the model
    4242``django.contrib.sessions.models.Session``). Though this is convenient, in
  • docs/topics/i18n.txt

    diff -r 07be6b6eaea0 docs/topics/i18n.txt
    a b obtain) the language translations themse  
    395395    application) and English strings (from Django itself). If you want to
    396396    support a locale for your application that is not already part of
    397397    Django, you'll need to make at least a minimal translation of the Django
    398     core. See the relevant :ref:LocaleMiddleware note`<locale-middleware-notes>`
     398    core. See the relevant :ref:`LocaleMiddleware note<locale-middleware-notes>`
    399399    for more details.
    400400
    401401Message files
  • docs/topics/templates.txt

    diff -r 07be6b6eaea0 docs/topics/templates.txt
    a b or CheetahTemplate_, you should feel rig  
    3737
    3838Templates
    3939=========
     40
     41.. highlightlang:: html+django
    4042
    4143A template is simply a text file. It can generate any text-based format (HTML,
    4244XML, CSV, etc.).
Back to Top