From b3c01b389ccc715a91c0866316261ea72507ede5 Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Sun, 9 Dec 2007 08:10:09 +0000 Subject: [PATCH] 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 --- docs/custom_model_fields.txt | 4 ++++ 1 file changed, 4 insertions(+) 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)`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~