Git Product home page Git Product logo

django-money-rates's People

Contributors

psykopear avatar silvanocerza avatar synasius avatar tzenderman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-money-rates's Issues

Moneyed dependency

After merging pull request #3 new dependency in file utils.py has been created:

import moneyed

A reason why modules were messed up is not clear. There was two independent modules moneyed for storing money type and djmoney_rates for money convertation.
If someone wants to use these modules together - why not, but there are no needs to inject one into another.

By pull request #3 was implemented one particular usage case of this module. This is not right and breaks module structure.

CC: @tzenderman

Unsupported notice

If this is library is no longer supported, which it looks like it mightn't be, a notice on the README would be useful. Especially considering this library is recommended by https://github.com/django-money/django-money which is currently supported.

For others reading, issues I ran into trying to get this to work this afternoon in Django 1.10:

  • Importlib deprecation error in Django >=1.9 as per #11, #16 โ€“ I hacked this fixed in my install to see if the library otherwise worked
  • Migrations aren't included or explained, I had to generate these then copy them into my project out of site-packages
  • Update rates task doesn't appear to register โ€“ I've included the app in INSTALLED_APPS and even chucked the import in, but nada, doesn't seem to show up

I am going to look for alternatives at this point as I'm getting all of the smells that I shouldn't be using this.

No support for Django 1.9

When using in Django 1.9 one can get:

ImportError: cannot import name importlib

django.utils.importlib was deprecated for Django 1.9

"djmoney_rates_ratesource" does not exist

Hello,
I installed this package as instructed via pip. Any attempt to use the example method or update currency produces the following:

django.db.utils.ProgrammingError: relation "djmoney_rates_ratesource" does not exist
LINE 1: ..., "djmoney_rates_ratesource"."base_currency" FROM "djmoney_r..

Specs:
Windows 7
Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:43:06) [MSC v.1600 32 bit (Intel)] on win32
Django 1.8.2
py-moneyed 0.5.0

"djmoney_rates_ratesource" does not exist

Following errors retrieved when running python manage.py update_rates

CommandError: Error during rate update: relation "djmoney_rates_ratesource" does not exist
LINE 1: ..., "djmoney_rates_ratesource"."base_currency" FROM "djmoney_r...

Updated settings.py to use the standard importlib since django.utils.importlib has been removed in 1.9.
#9

Using Django 1.9 and Python 2.7.

I have run migration after performing the quick start and setting up environment, no error found and it run successfully. Verified in postgres DB, the said table "djmoney_rates_ratesource" is not created.

Any help would be appreciated!

Python 3 error with updating_rates management command

Using python 3.3.3 and django 1.6, I get the following error when attempting to update rates:

$ python manage.py syncdb
Creating tables ...
Creating table djmoney_rates_ratesource
Creating table djmoney_rates_rate
Installing custom SQL ...
Installing indexes ...
Installed 0 object(s) from 0 fixture(s)
$ python manage.py update_rates
CommandError: Error during rate update: Error retrieving rates: can't use a string pattern on a bytes-like object

convert_money should return money instance?

Hey!

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.

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.

I will try to add some basic installation info to the Readme soon, is that ok?

-Tim

Where is currencies.util.calculate_price?

Hi, I'm just upgrading dependencies in one of my project, I notice the function currencies.utils.calculate_price is gone, I used to use this to do some currency conversion in a backend process.

I have tracked the deletion up to this commit 39b785a, and I notice there's now a currencies.utils.calculate is that the same function that just got renamed? The commit message isn't helpful at all, it doesn't explain the changes that were made.

Thanks for the help!

PyPi Version

Thanks for maintaining this package, it's great. Would it be possible to get the PyPi version updated? I was getting an error that was due to an incompatibility with Django 1.10, which has since been fixed in the master branch. I'm currently pip installing from master, which has fixed my issue, but it looks like the latest version of this package on PyPi is from 2014-01-12 -- would it be possible to get a new package and version up on there?

Thanks!

Caching of rates lookup.

Currently at least 2 database queries are performed for each currency conversion. This means that using django-money-rates for some tasks becomes infeasible, for example converting a large number of money amounts into a canonical currency so that they can be sorted according to true value.

With the current setup where rates are updated via a cronjob I don't think there would be a particular disadvantage in caching the results for 60s however possibly a more robust solution would be to use a configurable rates source backend which could be over-ridden to allow someone to add whatever caching logic they require.

At the moment I'm simply monkey patching the relevant functions:

djmoney_rates.utils.get_rate = memoize(djmoney_rates.utils.get_rate)
djmoney_rates.utils.get_rate_source = memoize(djmoney_rates.utils.get_rate_source)

Let me know if you have any thoughts or questions.

Thanks,
Mike

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.