Monday, May 28, 2018

Re: money field question



On Mon., 28 May 2018, 7:50 pm Mike Dewhirst, <miked@dewhirst.com.au> wrote:
On 24/05/2018 12:03 PM, Mike Dewhirst wrote:
> On 23/05/2018 12:31 PM, Simon McConnell wrote:
>> I'm in a similar boat at the moment. There
>> is https://github.com/vimeo/py-money too.
>
> I looked at that but it probably won't ever support exchange rates.
> Not sure yet if that is a show stopper because maybe forex is a
> separate thing anyway. I do need exchange rates in another project and
> I'd like choose a MoneyField which works in all projects.

On reflection I don't think exchange rates are any sort of show-stopper.
I either agree on an exchange rate with the client ahead of time and do
a forex deal without a rate (and wear the loss or gain when actually
exchanged) or bill in AUD and expect AUD to be remitted. I don't think I
want the complication of the MoneyField doing what someone else thinks
should happen.

Agreed. Currency exchange happens at the financial institution, not in our web apps. It would only be useful for estimation in my mind (I see no need for it in my application so haven't thought much about it). 



>
>> Note that django-money uses py-moneyed which does not yet use Babel,
>> so rendering of the correct symbol is limited to a few hardcoded
>> currencies.

But py-moneyed does claim a complete dictionary of ISO 4217 currencies.


https://github.com/limist/py-moneyed/blob/master/moneyed/localization.py only has the localisation configured for a handful of currencies, and not our precious AUD :). The shortest party would be adding them all in or doing https://github.com/limist/py-moneyed/issues/22

It also supports Python 2.7 which is useful for me because I haven't yet
rebuilt apache/mod_wsgi for py3 on my Ubuntu VMs. I wish there was a
pill to cure procrastination.

Work with what you've got (that being procrastination): http://www.structuredprocrastination.com


poswald/python-money does the same and looks interesting. Might go there
and see how it works. It also has form and field helpers.

Mike


>
> Interesting. I don't use Babel yet. But it is on the horizon.
>
> I'm beginning to see why Django doesn't (yet?) have a built-in
> MoneyField and I'm still interested in experience with differences
> between them.
>
> Mike
>
>>
>>
>> https://github.com/python-babel/babel
>>
>>
>> On Tuesday, 22 May 2018 11:25:04 UTC+10, Mike Dewhirst wrote:
>>
>>     I have just read ...
>>
>>     * Martin Fowler's Money base pattern (P488 to 495)
>>     https://martinfowler.com/eaaCatalog/money.html
>>     <https://martinfowler.com/eaaCatalog/money.html>
>>     * https://github.com/poswald/python-money
>>     <https://github.com/poswald/python-money>
>>     * https://github.com/django-money/django-money
>>     <https://github.com/django-money/django-money>
>>     * https://github.com/limist/py-moneyed
>>     <https://github.com/limist/py-moneyed>
>>
>>     ... and I am spoiled for choice. I was going to just use a
>>     DecimalField
>>     and CharField for currency and do my own thing when I decided to
>> pull
>>     Martin Fowler off my shelf and saw how careful I was going to need
>>     to be.
>>
>>     My question: Is Django planning to adopt one or other of the above
>>     implementations?
>>
>>     I'm just trying to short-circuit more detailed analysis of these
>>     packages and perhaps others I haven't yet found. If one is on the
>>     horizon for Django I'll just go with that.
>>
>>     Thanks
>>
>>     Mike
>>
>>
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it,
>> send an email to django-users+unsubscribe@googlegroups.com
>> <mailto:django-users+unsubscribe@googlegroups.com>.
>> To post to this group, send email to django-users@googlegroups.com
>> <mailto:django-users@googlegroups.com>.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/762af31e-56fd-4976-bef2-f627c5673f38%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/762af31e-56fd-4976-bef2-f627c5673f38%40googlegroups.com?utm_medium=email&utm_source=footer>.
>>
>> For more options, visit https://groups.google.com/d/optout.
>


--

Climate Pty Ltd
PO Box 308
Mount Eliza
Vic 3930
Australia +61

T: 03 9034 3977
M: 0411 704 143


--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/O51wKkudE_U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/65f7387c-aa75-f29c-9f99-74095d5e9c7d%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAB-XqiXr4-jdqkjm8p3GJZo4gopoNK5BL6%2B-a%2BYezagf%3D0MWTw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment