Ticket #347 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

Decimal field cannot contain default values

Reported by: jbar@… Owned by: andrew
Priority: minor Milestone: 0.7
Component: migrations Version: 0.7-pre
Keywords: default values Cc:

Description

If model contains a decimal field with a default value, as in

price = DecimalField(default=Decimal('1.0'))

south will complain about missing definition of Decimal. Now I have to include

from decimal import Decimal

in every migration which uses this model. In the versions prior to 0.7-pre, importing Decimal at the beginning of the model definition was enough, because south would put

from myproject.apps.myapp.models import *

at the beginning of migration.

Change History

comment:1 Changed 5 years ago by andrew

  • Status changed from new to closed
  • Resolution set to fixed
  • Milestone set to 0.7

Fixed in [eb57707fb001].

Note: See TracTickets for help on using tickets.