Kaydet (Commit) b3c01b38 authored tarafından Malcolm Tredinnick's avatar Malcolm Tredinnick

Tweaked the custom field documentation so that people reading about to_python()…

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
üst 5ed205bc
...@@ -382,6 +382,10 @@ database, so we need to be able to process strings and ``Hand`` instances in ...@@ -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 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. 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)`` ``get_db_prep_save(self, value)``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment