You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which is correct. However the migration needs a line like this;-
from decimal import ROUND_HALF_EVEN
to import the correct enumeration symbol. I presume if one of the other rounding options is chosen, that would need to be imported too.
On a side note, I notice the default= option doesnt seem to perculate across to the migrations (Specifically in my created_on=DateTimeField(datetime.datetime.now) field) Not sure if thats documented, will perhaps investigate later if I get a chance.
Best regards, and thanks for this great little library.
The text was updated successfully, but these errors were encountered:
shayneoneill
changed the title
Migrations not importing from decimal
Migrations not importing rounding enumeration from decimal
Jul 6, 2018
So in one of my models I have a field like this;-
bank_balance= DecimalField(max_digits=20,decimal_places=2,auto_round=True,null=True)
The migration creates a line as follows;-
bank_balance = pw.DecimalField(auto_round=True, decimal_places=2, max_digits=20, null=True, rounding=ROUND_HALF_EVEN)
Which is correct. However the migration needs a line like this;-
from decimal import ROUND_HALF_EVEN
to import the correct enumeration symbol. I presume if one of the other rounding options is chosen, that would need to be imported too.
On a side note, I notice the default= option doesnt seem to perculate across to the migrations (Specifically in my
created_on=DateTimeField(datetime.datetime.now)
field) Not sure if thats documented, will perhaps investigate later if I get a chance.Best regards, and thanks for this great little library.
The text was updated successfully, but these errors were encountered: