                  return 'datetime'
              else:
                  return 'timestamp'
  
  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.
  
  Some database column types accept parameters, such as ``CHAR(25)``, where the
  parameter ``25`` represents the maximum column length. In cases like these,
  it's more flexible if the parameter is specified in the model rather than being
  hard-coded in the ``db_type()`` method. For example, it wouldn't make much
 
</s> remove This method is called just prior to :meth:`get_db_prep_save` and should return
 </s> add This method is called just prior to :meth:`.get_db_prep_save` and should return </s> remove ``datetime``. The simplest way to handle this in a ``db_type()`` method is to
check the ``connection.settings_dict['ENGINE']`` attribute.
 </s> add ``datetime``. The simplest way to handle this in a :meth:`.db_type`
method is to check the ``connection.settings_dict['ENGINE']`` attribute. </s> remove This is the reverse of :meth:`to_python` when working with the
 </s> add This is the reverse of :meth:`.to_python` when working with the </s> remove :meth:`get_db_prep_value` is the method where those conversions should
 </s> add :meth:`.get_db_prep_value` is the method where those conversions should </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.
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.
                  return 'datetime'
              else:
                  return 'timestamp'
  
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.
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.
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.
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.
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.
  
  Some database column types accept parameters, such as ``CHAR(25)``, where the
  parameter ``25`` represents the maximum column length. In cases like these,
  it's more flexible if the parameter is specified in the model rather than being
  hard-coded in the ``db_type()`` method. For example, it wouldn't make much
keep keep keep keep replace replace replace 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