Comments (4)
Hi @tzenderman
Very nice work on this repo, I'm integrating it now to my project and want to contribute back to the repo soon as well.
Thnx! I'll love to have your contributions :)
With regards to the djmoney_rates.utils.convert_money function, is there a reason it returns a Decimal and not a Money instance? I can always create another util that will return the money instance the way I am thinking, but let me know.
The point here is that I'd like to have two functions: a vanilla convert_money
that returns decimal and a specialized function that outputs Money instances. The current convert_money
is a base that one can easily wraps, but we should definitely add the specialized version that works with money instances. something like:
def convert_money(money, currency_to):
# money should be an instance of moneyed.Money
amount = base_convert_money(money.amount, money.currency.code, currency_to)
return moneyed.Money(amount, currency_to)
What do you think? Does it work?
I will try to add some basic installation info to the Readme soon, is that ok?
Great! thnx! Also add yourself to contributors in AUTHORS.rst
from django-money-rates.
Awesome!
With respect to the converting money functions, that's exactly what I was thinking. I wasn't sure if you had already wired convert_money
into some projects and would break if we made it return a money instance now though. base_convert_money
sounds right and I think the convert_money
works correctly too. I'll fork, try it out and PR it back soon.
In the project we're using this in, we're updating exchange rates with a celery period_task once a day. I'll see how I can add that as a setting in the repo too as I think it would be super useful...
from django-money-rates.
I'll fork, try it out and PR it back soon.
👍
In the project we're using this in, we're updating exchange rates with a celery period_task once a day. I'll see how I can add that as a setting in the repo too as I think it would be super useful...
Yep, would be nice to have such a feature! Keep in mind to put this code in a separate PR. that way it's easier for me to review.
from django-money-rates.
this is solved in #3
from django-money-rates.
Related Issues (11)
- "djmoney_rates_ratesource" does not exist HOT 2
- No support for Django 1.9 HOT 1
- Where is currencies.util.calculate_price? HOT 1
- Unsupported notice HOT 4
- PyPi Version HOT 2
- ForeignKey.on_delete is mandatory since django 2.0
- Python 3 error with updating_rates management command HOT 2
- Caching of rates lookup. HOT 4
- Moneyed dependency HOT 1
- "djmoney_rates_ratesource" does not exist HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-money-rates.