Where should one put application specific constants - those that change
sometimes(1) and those that never change? For example, I am creating a
simple inventory application for my mother's estate. Several quotes for
her jewelry are based on the weight of the jewelry and the current price of
gold.
I
It depends on the complexity of the issue.
The price of gold does fluctuate. On the grounds that I might want to
change it more often than I would want to ssh in, edit a file, and restart,
I would tend to put price of gold in the database, that is, in a model of
which there may only be one instan
Thanks! Very clear and helpful.
Mark
On Feb 14, 2014 9:54 AM, "Bill Freeman" wrote:
> It depends on the complexity of the issue.
>
> The price of gold does fluctuate. On the grounds that I might want to
> change it more often than I would want to ssh in, edit a file, and restart,
> I would tend
To round this, for the price of gold, and if you are using the
django.contrib.admin interface, you can use Django Solo or similar
singleton model. That way you can edit your "business properties" within
the admin interface:
https://pypi.python.org/pypi/django-solo
On Friday, February 14, 2014
I would suggest that your example, the price of gold, isn't a constant. If
you want to treat it as such then I agree with the above answers. However,
you could also look around for APIs that publish commodities values and
actually pull the real values in real (or semi real) time.
--
You receiv
Kirby,
You have a good point. However, in this use case I am dealing with
a jewelry store buying gold at their "market" rate. It is not the same as
owning gold and the value changes based on a published (ie available
through an API) rate. The jewelry store market rate for gold changes
slowly, and
6 matches
Mail list logo