Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrations not importing rounding enumeration from decimal #86

Open
shayneoneill opened this issue Jul 6, 2018 · 0 comments
Open

Migrations not importing rounding enumeration from decimal #86

shayneoneill opened this issue Jul 6, 2018 · 0 comments

Comments

@shayneoneill
Copy link

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.

@shayneoneill shayneoneill changed the title Migrations not importing from decimal Migrations not importing rounding enumeration from decimal Jul 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant