  
  If you aim to build a database-agnostic application, you should account for
  differences in database column types. For example, the date/time column type
  in PostgreSQL is called ``timestamp``, while the same column in MySQL is called
  ``datetime``. The simplest way to handle this in a ``db_type()`` method is to
  check the ``connection.settings_dict['ENGINE']`` attribute.
  
  For example::
  
      class MyDateField(models.Field):
          def db_type(self, connection):
 
</s> remove The :meth:`db_type` method is only called by Django when the framework
constructs the ``CREATE TABLE`` statements for your application -- that is, when
you first create your tables. It's not called at any other time, so it can
afford to execute slightly complex code, such as the ``connection.settings_dict``
check in the above example.
 </s> add The :meth:`.db_type` method is only called by Django when the framework
constructs the ``CREATE TABLE`` statements for your application -- that is,
when you first create your tables. It's not called at any other time, so it can
afford to execute slightly complex code, such as the
``connection.settings_dict`` check in the above example. </s> remove field with Django by subclassing ``Field`` and implementing the :meth:`db_type`
method, like so::
 </s> add field with Django by subclassing ``Field`` and implementing the
:meth:`.db_type` method, like so:: </s> remove should be made in the call to :meth:`get_db_prep_value`.
 </s> add should be made in the call to :meth:`.get_db_prep_value`. </s> remove :meth:`db_type`. This will cause Django's SQL creation code to skip over this
field. You are then responsible for creating the column in the right table in
some other way, of course, but this gives you a way to tell Django to get out of
the way.
 </s> add :meth:`.db_type`. This will cause Django's SQL creation code to skip
over this field. You are then responsible for creating the column in the right
table in some other way, of course, but this gives you a way to tell Django to
get out of the way.
``datetime``. The simplest way to handle this in a :meth:`.db_type`
method is to check the ``connection.settings_dict['ENGINE']`` attribute.
  
  If you aim to build a database-agnostic application, you should account for
  differences in database column types. For example, the date/time column type
  in PostgreSQL is called ``timestamp``, while the same column in MySQL is called
``datetime``. The simplest way to handle this in a :meth:`.db_type`
method is to check the ``connection.settings_dict['ENGINE']`` attribute.
``datetime``. The simplest way to handle this in a :meth:`.db_type`
method is to check the ``connection.settings_dict['ENGINE']`` attribute.
  
  For example::
  
      class MyDateField(models.Field):
          def db_type(self, connection):
keep keep keep keep replace replace keep keep keep keep keep
 Fixed #15308 -- Sphinx/reST fixes for the Custom Model Fields docs.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15547 bcc190cf-cafb-0310-a4f2-bffc1f526a37 
docs/howto/custom-model-fields.txt