  Database.register_converter("datetime", util.typecast_timestamp)
  Database.register_converter("timestamp", util.typecast_timestamp)
  Database.register_converter("TIMESTAMP", util.typecast_timestamp)
  
  def utf8rowFactory(cursor, row):
      def utf8(s):
          if type(s) == unicode:
 
</s> remove         return float(data)
 </s> add         try: 
            import decimal 
        except ImportError:
            from django.utils import decimal
        try: 
            return decimal.Decimal(data) 
        except decimal.InvalidOperation, e: 
            raise ValueError, e  </s> remove         validator_list = [self.isValidFloat] + validator_list
        TextField.__init__(self, field_name, max_digits+2, max_digits+2, is_required, validator_list)
 </s> add         validator_list = [self.isValidDecimal] + validator_list 
        # Initialise the TextField, making sure it's large enough to fit the number with a - sign and a decimal point. 
        super(DecimalField, self).__init__(field_name, max_digits+2, max_digits+2, is_required, validator_list) 
Database.register_converter("decimal", util.typecast_decimal)
Database.register_adapter(decimal.Decimal, util.rev_typecast_decimal)
  Database.register_converter("datetime", util.typecast_timestamp)
  Database.register_converter("timestamp", util.typecast_timestamp)
  Database.register_converter("TIMESTAMP", util.typecast_timestamp)
Database.register_converter("decimal", util.typecast_decimal)
Database.register_adapter(decimal.Decimal, util.rev_typecast_decimal)
  
  def utf8rowFactory(cursor, row):
      def utf8(s):
          if type(s) == unicode:
keep keep add keep keep keep keep
 Fixed #2365, #3324 -- Renamed FloatField to DecimalField and changed the code
to return Decimal instances in Python for this field. Backwards incompatible
change.

Added a real FloatField (stores floats in the database) and support for
FloatField and DecimalField in newforms (analogous to IntegerField).

Included decimal.py module (as django.utils._decimal) from Python 2.4. This is
license compatible with Django and included for Python 2.3 compatibility only.

Large portions of this work are based on patches from Andy Durdin and Jorge
Gajon.



git-svn-id: http://code.djangoproject.com/svn/django/trunk@5302 bcc190cf-cafb-0310-a4f2-bffc1f526a37 
django/db/backends/sqlite3/base.py