diff options
| author | Justin Bronn <jbronn@gmail.com> | 2007-08-26 17:47:34 +0000 |
|---|---|---|
| committer | Justin Bronn <jbronn@gmail.com> | 2007-08-26 17:47:34 +0000 |
| commit | cb64f5375cc1884226cad05b671e8660214a4a92 (patch) | |
| tree | 740d3abe9b8d2ed8c8255c9b6ea378950cbf6b39 /docs/tutorial01.txt | |
| parent | 2052b508eb92c62fc0678efd4936c5ec1e0e735b (diff) | |
gis: Merged revisions 6000-6020 via svnmerge from [repos:django/trunk trunk].
git-svn-id: http://code.djangoproject.com/svn/django/branches/gis@6021 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/tutorial01.txt')
| -rw-r--r-- | docs/tutorial01.txt | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/docs/tutorial01.txt b/docs/tutorial01.txt index cf2b76e9be..60c527216b 100644 --- a/docs/tutorial01.txt +++ b/docs/tutorial01.txt @@ -259,6 +259,22 @@ These concepts are represented by simple Python classes. Edit the choice = models.CharField(max_length=200) votes = models.IntegerField() +.. admonition:: Errors about ``max_length`` + + If Django gives you an error message saying that ``max_length`` is + not a valid argument, you're most likely using an old version of + Django. (This version of the tutorial is written for the latest + development version of Django.) If you're using a Subversion checkout + of Django's development version (see `the installation docs`_ for + more information), you shouldn't have any problems. + + If you want to stick with an older version of Django, you'll want to + switch to `the Django 0.96 tutorial`_, because this tutorial covers + several features that only exist in the Django development version. + +.. _the installation docs: ../install/ +.. _the Django 0.96 tutorial: ../0.96/tutorial01/ + The code is straightforward. Each model is represented by a class that subclasses ``django.db.models.Model``. Each model has a number of class variables, each of which represents a database field in the model. @@ -487,6 +503,23 @@ the ``polls/models.py`` file) and adding a ``__unicode__()`` method to both def __unicode__(self): return self.choice +.. admonition:: If ``__unicode__()`` doesn't seem to work + + If you add the ``__unicode__()`` method to your models and don't + see any change in how they're represented, you're most likely using + an old version of Django. (This version of the tutorial is written + for the latest development version of Django.) If you're using a + Subversion checkout of of Django's development version (see `the + installation docs`_ for more information), you shouldn't have any + problems. + + If you want to stick with an older version of Django, you'll want to + switch to `the Django 0.96 tutorial`_, because this tutorial covers + several features that only exist in the Django development version. + +.. _the installation docs: ../install/ +.. _the Django 0.96 tutorial: ../0.96/tutorial01/ + It's important to add ``__unicode__()`` methods to your models, not only for your own sanity when dealing with the interactive prompt, but also because objects' representations are used throughout Django's automatically-generated |
