A Django app that provides a custom model field for handling financial asset object as a single database field, abstracting the asset name(currency) and value(amount) into a single object (At the python and Database Level).
I wish to create a class (object) that represent monetarily value agnosticly, it should encapsulate the asset value and currency in a single python object/database field.
Examples include (Assuming said class is called Asset):
- 1000 naira = Asset(1000.00 'NGN')
- 1 US dollar = Asset(1.00, 'USD')
- 0.0005 Bitcoin = Asset(0.0005, 'BTC')
To install the app, run the following command:
To use the custom model field, you need to import it in your model file and add it as a field to your model.
from custom_money_field.fields import AssetField
class MyModel(models.Model):
custom_field = AssetField()
class should provide an interface to support conversion and mathematical interations between standard current units
If you would like to contribute to this project, please follow the instructions below:
- Fork the repository
- Clone the repository to your local machine
- Create a new branch for your changes
- Make the necessary changes and commit those changes to the new branch
- Push the branch to the forked repository
- Submit a pull request
This project is licensed under the MIT License. For more information, see the LICENSE file.
- Brian Obot [email protected]