Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Add decimal field #43
Conversation
|
Feature parity with Django is a goal and it should be easy for Django developers to adopt. We should at least keep a reference to Django if not use the DecimalField parameter naming. I do see wisdom, in keeping the parameter naming the same as the underlying SQLAlchemy implementation so we appeal to both developer communities. Maybe adding doc strings would strike a balance and put us on a path to auto-generate more documentation. """ A fixed-precision decimal number field,
A fixed-precision decimal number represented in Python by a Decimal instance. It extends `Typesystem.Decimal`_
Args:
scale (int): the number of decimal places
precision (int): the maximum number of digits
.. _Typesystem.Decimal:
https://www.encode.io/typesystem/fields/#decimal
""" |
|
@tomchristie I'd like your input here. Django uses max_digits and decimal_places to define DecimalFields. SQL Alchemy and this PR use scale and precision, Typesystem uses precision internally. I know you want to maintain Django compatibility to some extent. My gut says use scale and precision internally, but use kwargs instead of positional args to allow both sets of parameters and provide compatibility with both. What would @tomchristie do? |
Simple draft of using the decimal field #42
I will be glad to continue after the discussion