Django

Code

Changeset 6006

Show
Ignore:
Timestamp:
08/25/07 13:43:32 (1 year ago)
Author:
adrian
Message:

Fixed #5195 -- Added notes to docs/tutorial01.txt about max_length and unicode() changes and 0.96 vs. development version. Thanks, ubernostrum

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/docs/tutorial01.txt

    r5871 r6006  
    259259        choice = models.CharField(max_length=200) 
    260260        votes = models.IntegerField() 
     261 
     262.. adminition:: Errors about ``max_length`` 
     263 
     264   If Django gives you an error message saying that ``max_length`` is 
     265   not a valid argument, you're most likely using an old version of 
     266   Django. (This version of the tutorial is written for the latest 
     267   development version of Django.) If you're using a Subversion checkout 
     268   of Django's development version (see `the installation docs`_ for 
     269   more information), you shouldn't have any problems. 
     270 
     271   If you want to stick with an older version of Django, you'll want to 
     272   switch to `the Django 0.96 tutorial`_, because this tutorial covers 
     273   several features that only exist in the Django development version. 
     274 
     275.. _the installation docs: ../install/ 
     276.. _the Django 0.96 tutorial: ../0.96/tutorial01/ 
    261277 
    262278The code is straightforward. Each model is represented by a class that 
     
    488504            return self.choice 
    489505 
     506.. admonition:: If ``__unicode__()`` doesn't seem to work 
     507 
     508   If you add the ``__unicode__()`` method to your models and don't 
     509   see any change in how they're represented, you're most likely using 
     510   an old version of Django. (This version of the tutorial is written 
     511   for the latest development version of Django.) If you're using a 
     512   Subversion checkout of of Django's development version (see `the 
     513   installation docs`_ for more information), you shouldn't have any 
     514   problems. 
     515 
     516   If you want to stick with an older version of Django, you'll want to 
     517   switch to `the Django 0.96 tutorial`_, because this tutorial covers 
     518   several features that only exist in the Django development version. 
     519 
     520.. _the installation docs: ../install/ 
     521.. _the Django 0.96 tutorial: ../0.96/tutorial01/ 
     522 
    490523It's important to add ``__unicode__()`` methods to your models, not only for 
    491524your own sanity when dealing with the interactive prompt, but also because