Django

Code

Changeset 6677

Show
Ignore:
Timestamp:
11/15/07 03:21:36 (10 months ago)
Author:
mtredinnick
Message:

Fixed #5892, #5930 -- Fixed some typos pointed out by ars@iki.fi and nickl.

Files:

Legend:

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

    r6652 r6677  
    5757We assign to and retrieve from the ``hand`` attribute in our model just like 
    5858any other Python class. The trick is to tell Django how to handle saving and 
    59 loading such an object 
     59loading such an object. 
    6060 
    6161In order to use the ``Hand`` class in our models, we **do not** have to change 
     
    9999Say, all the *north* cards first, then the *east*, *south* and *west* cards, in 
    100100that order. So ``Hand`` objects can be saved to text or character columns in 
    101 the database 
     101the database. 
    102102 
    103103What does a field class do? 
     
    234234will always be called when the attribute is initialised. 
    235235 
    236 Our ``HandleField`` class now looks like this:: 
    237  
    238     class HandleField(models.Field): 
     236Our ``HandField`` class now looks like this:: 
     237 
     238    class HandField(models.Field): 
    239239        __metaclass__ = models.SubfieldBase 
    240240 
     
    550550-------------------- 
    551551 
    552 Writing a custom field can be a tricky process sometime, particularly if you 
     552Writing a custom field can be a tricky process sometimes, particularly if you 
    553553are doing complex conversions between your Python types and your database and 
    554554serialization formats. A couple of tips to make things go more smoothly: