diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-12-09 08:10:09 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-12-09 08:10:09 +0000 |
| commit | b3c01b389ccc715a91c0866316261ea72507ede5 (patch) | |
| tree | 25773476dd11bd4018efb2c797c4755b16bf5dbd /docs | |
| parent | 5ed205bc8a7940f3908b1db2cec32cfcabe47388 (diff) | |
Tweaked the custom field documentation so that people reading about to_python() get a big hint to look at the SubfieldBase metaclass.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6902 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/custom_model_fields.txt | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/docs/custom_model_fields.txt b/docs/custom_model_fields.txt index 0cf2549746..80c9de7d16 100644 --- a/docs/custom_model_fields.txt +++ b/docs/custom_model_fields.txt @@ -382,6 +382,10 @@ database, so we need to be able to process strings and ``Hand`` instances in Notice that we always return a ``Hand`` instance from this method. That's the Python object type we want to store in the model's attribute. +**Remember:** If your custom field needs the ``to_python()`` method to be +called when it is created, you should be using `The SubfieldBase metaclass`_ +mentioned earlier. Otherwise ``to_python()`` won't be called automatically. + ``get_db_prep_save(self, value)`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
