Skip to content

Commit

Permalink
Fixed #5892, #5930 -- Fixed some typos pointed out by ars@iki.fi and …
Browse files Browse the repository at this point in the history
…nickl.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@6677 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
malcolmt committed Nov 15, 2007
1 parent a5e960d commit 84c1e78
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/custom_model_fields.txt
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ would like to be able to things like this in our models (we assume the


We assign to and retrieve from the ``hand`` attribute in our model just like We assign to and retrieve from the ``hand`` attribute in our model just like
any other Python class. The trick is to tell Django how to handle saving and any other Python class. The trick is to tell Django how to handle saving and
loading such an object loading such an object.


In order to use the ``Hand`` class in our models, we **do not** have to change In order to use the ``Hand`` class in our models, we **do not** have to change
this class at all. This is ideal, because it means you can easily write this class at all. This is ideal, because it means you can easily write
Expand Down Expand Up @@ -98,7 +98,7 @@ For our ``Hand`` example, we could convert the card data to a string of 104
characters by concatenating all the cards together in a pre-determined order. characters by concatenating all the cards together in a pre-determined order.
Say, all the *north* cards first, then the *east*, *south* and *west* cards, in Say, all the *north* cards first, then the *east*, *south* and *west* cards, in
that order. So ``Hand`` objects can be saved to text or character columns in that order. So ``Hand`` objects can be saved to text or character columns in
the database the database.


What does a field class do? What does a field class do?
--------------------------- ---------------------------
Expand Down Expand Up @@ -233,9 +233,9 @@ sure your field subclass uses ``django.db.models.SubfieldBase`` as its
metaclass. This ensures that the ``to_python()`` method, documented below_, metaclass. This ensures that the ``to_python()`` method, documented below_,
will always be called when the attribute is initialised. will always be called when the attribute is initialised.


Our ``HandleField`` class now looks like this:: Our ``HandField`` class now looks like this::


class HandleField(models.Field): class HandField(models.Field):
__metaclass__ = models.SubfieldBase __metaclass__ = models.SubfieldBase


def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
Expand Down Expand Up @@ -549,7 +549,7 @@ we can reuse some existing conversion code::
Some general advice Some general advice
-------------------- --------------------


Writing a custom field can be a tricky process sometime, particularly if you Writing a custom field can be a tricky process sometimes, particularly if you
are doing complex conversions between your Python types and your database and are doing complex conversions between your Python types and your database and
serialization formats. A couple of tips to make things go more smoothly: serialization formats. A couple of tips to make things go more smoothly:


Expand Down

0 comments on commit 84c1e78

Please sign in to comment.