Giter Site home page Giter Site logo

brianobot / djangocustommoneyfield Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 62 KB

Django based custom money fields to facilitate storing money attributes (value, currency, etc) as a single object

License: MIT License

Python 100.00%
django-fields money-objects currency django custom-django-modelfield

djangocustommoneyfield's Introduction

Custom DjangoMoneyField

ย 

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).

Description:

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')

Installation

To install the app, run the following command:

Usage

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()

Feature:

class should provide an interface to support conversion and mathematical interations between standard current units

Contribution

If you would like to contribute to this project, please follow the instructions below:

  1. Fork the repository
  2. Clone the repository to your local machine
  3. Create a new branch for your changes
  4. Make the necessary changes and commit those changes to the new branch
  5. Push the branch to the forked repository
  6. Submit a pull request

License

This project is licensed under the MIT License. For more information, see the LICENSE file.

Maintainer:

djangocustommoneyfield's People

Contributors

brianobot avatar

Stargazers

 avatar Roman avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.