Skip to content

Commit f1edb8c

Browse files
Fixed #5097 -- Made various updates and corrections to the documentation. Thanks, Nicola Larosa
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5825 bcc190cf-cafb-0310-a4f2-bffc1f526a37
1 parent 404bf3b commit f1edb8c

File tree

6 files changed

+27
-29
lines changed

6 files changed

+27
-29
lines changed

docs/contributing.txt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -545,11 +545,9 @@ To run the tests, ``cd`` to the ``tests/`` directory and type::
545545
./runtests.py --settings=path.to.django.settings
546546

547547
Yes, the unit tests need a settings module, but only for database connection
548-
info -- the ``DATABASE_NAME`` (required, but will be ignored),
549-
``DATABASE_ENGINE``, ``DATABASE_USER`` and ``DATABASE_PASSWORD`` settings. You
550-
will also need a ``ROOT_URLCONF`` setting (its value is ignored; it just needs
551-
to be present) and a ``SITE_ID`` setting (any non-zero integer value will do)
552-
in order for all the tests to pass.
548+
info, with the ``DATABASE_ENGINE`` setting. You will also need a ``ROOT_URLCONF``
549+
setting (its value is ignored; it just needs to be present) and a ``SITE_ID``
550+
setting (any non-zero integer value will do) in order for all the tests to pass.
553551

554552
The unit tests will not touch your existing databases; they create a new
555553
database, called ``django_test_db``, which is deleted when the tests are

docs/i18n.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ To pluralize, specify both the singular and plural forms with the
263263
Internally, all block and inline translations use the appropriate
264264
``ugettext`` / ``ungettext`` call.
265265

266-
Each ``RequestContext`` has access to two translation-specific variables:
266+
Each ``RequestContext`` has access to three translation-specific variables:
267267

268268
* ``LANGUAGES`` is a list of tuples in which the first element is the
269269
language code and the second is the language name (in that language).

docs/model-api.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ Django veterans: Note that the argument is now called ``max_length`` to
150150
provide consistency throughout Django. There is full legacy support for
151151
the old ``maxlength`` argument, but ``max_length`` is prefered.
152152

153-
``CommaSeparatedIntegerField``
153+
``CommaSeparatedIntegerField``
154154
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
155155

156156
A field of integers separated by commas. As in ``CharField``, the ``max_length``
@@ -737,7 +737,7 @@ Many-to-one relationships
737737
To define a many-to-one relationship, use ``ForeignKey``. You use it just like
738738
any other ``Field`` type: by including it as a class attribute of your model.
739739

740-
``ForeignKey`` requires a positional argument: The class to which the model is
740+
``ForeignKey`` requires a positional argument: the class to which the model is
741741
related.
742742

743743
For example, if a ``Car`` model has a ``Manufacturer`` -- that is, a
@@ -872,7 +872,7 @@ To define a many-to-many relationship, use ``ManyToManyField``. You use it just
872872
like any other ``Field`` type: by including it as a class attribute of your
873873
model.
874874

875-
``ManyToManyField`` requires a positional argument: The class to which the
875+
``ManyToManyField`` requires a positional argument: the class to which the
876876
model is related.
877877

878878
For example, if a ``Pizza`` has multiple ``Topping`` objects -- that is, a
@@ -969,7 +969,7 @@ model.
969969
This is most useful on the primary key of an object when that object "extends"
970970
another object in some way.
971971

972-
``OneToOneField`` requires a positional argument: The class to which the
972+
``OneToOneField`` requires a positional argument: the class to which the
973973
model is related.
974974

975975
For example, if you're building a database of "places", you would build pretty
@@ -1421,8 +1421,8 @@ that displays the ``__str__()`` representation of each object.
14211421

14221422
A few special cases to note about ``list_display``:
14231423

1424-
* If the field is a ``ForeignKey``, Django will display the ``__str__()``
1425-
of the related object.
1424+
* If the field is a ``ForeignKey``, Django will display the
1425+
``__unicode__()`` of the related object.
14261426

14271427
* ``ManyToManyField`` fields aren't supported, because that would entail
14281428
executing a separate SQL statement for each row in the table. If you
@@ -1672,7 +1672,7 @@ with an operator:
16721672
AND (first_name ILIKE 'lennon' OR last_name ILIKE 'lennon')
16731673

16741674
Note that the query input is split by spaces, so, following this example,
1675-
it's not currently not possible to search for all records in which
1675+
it's currently not possible to search for all records in which
16761676
``first_name`` is exactly ``'john winston'`` (containing a space).
16771677

16781678
``@``
@@ -1956,7 +1956,7 @@ Also, a couple of other bits of Django, such as the `syndication feed framework`
19561956
use ``get_absolute_url()`` as a convenience to reward people who've defined the
19571957
method.
19581958

1959-
.. syndication feed framework: ../syndication_feeds/
1959+
.. _syndication feed framework: ../syndication_feeds/
19601960

19611961
It's good practice to use ``get_absolute_url()`` in templates, instead of
19621962
hard-coding your objects' URLs. For example, this template code is bad::
@@ -2015,8 +2015,8 @@ Similarly, if you had a URLconf entry that looked like::
20152015
'day': self.created.day})
20162016
get_absolute_url = permalink(get_absolute_url)
20172017

2018-
Notice that we specify an empty sequence for the second argument in this case,
2019-
because we only want to pass keyword arguments, not named arguments.
2018+
Notice that we specify an empty sequence for the second parameter in this case,
2019+
because we only want to pass keyword parameters, not positional ones.
20202020

20212021
In this way, you're tying the model's absolute URL to the view that is used
20222022
to display it, without repeating the URL information anywhere. You can still

docs/overview.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Enjoy the free API
5454
==================
5555

5656
With that, you've got a free, and rich, Python API to access your data. The API
57-
is created on the fly: No code generation necessary::
57+
is created on the fly, no code generation necessary::
5858

5959
>>> from mysite.models import Reporter, Article
6060

@@ -124,7 +124,7 @@ is created on the fly: No code generation necessary::
124124
# Delete an object with delete().
125125
>>> r.delete()
126126

127-
A dynamic admin interface: It's not just scaffolding -- it's the whole house
127+
A dynamic admin interface: it's not just scaffolding -- it's the whole house
128128
============================================================================
129129

130130
Once your models are defined, Django can automatically create a professional,
@@ -250,7 +250,7 @@ Finally, Django uses the concept of "template inheritance": That's what the
250250
``{% extends "base.html" %}`` does. It means "First load the template called
251251
'base', which has defined a bunch of blocks, and fill the blocks with the
252252
following blocks." In short, that lets you dramatically cut down on redundancy
253-
in templates: Each template has to define only what's unique to that template.
253+
in templates: each template has to define only what's unique to that template.
254254

255255
Here's what the "base.html" template might look like::
256256

docs/tutorial01.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -461,10 +461,10 @@ Once you're in the shell, explore the database API::
461461
>>> p.question
462462
"What's up?"
463463
>>> p.pub_date
464-
datetime.datetime(2005, 7, 15, 12, 00, 53)
464+
datetime.datetime(2007, 7, 15, 12, 00, 53)
465465

466466
# Change values by changing the attributes, then calling save().
467-
>>> p.pub_date = datetime(2005, 4, 1, 0, 0)
467+
>>> p.pub_date = datetime(2007, 4, 1, 0, 0)
468468
>>> p.save()
469469

470470
# objects.all() displays all the polls in the database.
@@ -537,9 +537,9 @@ Let's jump back into the Python interactive shell by running
537537
>>> Poll.objects.filter(question__startswith='What')
538538
[<Poll: What's up?>]
539539

540-
# Get the poll whose year is 2005. Of course, if you're going through this
540+
# Get the poll whose year is 2007. Of course, if you're going through this
541541
# tutorial in another year, change as appropriate.
542-
>>> Poll.objects.get(pub_date__year=2005)
542+
>>> Poll.objects.get(pub_date__year=2007)
543543
<Poll: What's up?>
544544

545545
>>> Poll.objects.get(id=2)
@@ -580,9 +580,9 @@ Let's jump back into the Python interactive shell by running
580580

581581
# The API automatically follows relationships as far as you need.
582582
# Use double underscores to separate relationships.
583-
# This works as many levels deep as you want. There's no limit.
584-
# Find all Choices for any poll whose pub_date is in 2005.
585-
>>> Choice.objects.filter(poll__pub_date__year=2005)
583+
# This works as many levels deep as you want; there's no limit.
584+
# Find all Choices for any poll whose pub_date is in 2007.
585+
>>> Choice.objects.filter(poll__pub_date__year=2007)
586586
[<Choice: Not much>, <Choice: The sky>, <Choice: Just hacking again>]
587587

588588
# Let's delete one of the choices. Use delete() for that.

docs/tutorial02.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,8 @@ think they should.
362362
Customize the admin look and feel
363363
=================================
364364

365-
Clearly, having "Django administration" and "example.com" at the top of each
366-
admin page is ridiculous. It's just placeholder text.
365+
Clearly, having "Django administration" at the top of each admin page is
366+
ridiculous. It's just placeholder text.
367367

368368
That's easy to change, though, using Django's template system. The Django admin
369369
is powered by Django itself, and its interfaces use Django's own template
@@ -389,7 +389,7 @@ as above, then copy ``django/contrib/admin/templates/admin/base_site.html`` to
389389
``admin`` subdirectory.
390390

391391
Then, just edit the file and replace the generic Django text with your own
392-
site's name and URL as you see fit.
392+
site's name as you see fit.
393393

394394
Note that any of Django's default admin templates can be overridden. To
395395
override a template, just do the same thing you did with ``base_site.html`` --

0 commit comments

Comments
 (0)