Newbie Question - Where to store application constants?

2014-02-14 Thread Mark Phillips
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

Re: Newbie Question - Where to store application constants?

2014-02-14 Thread Bill Freeman
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

Re: Newbie Question - Where to store application constants?

2014-02-14 Thread Mark Phillips
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

Re: Newbie Question - Where to store application constants?

2014-02-15 Thread Camilo Torres
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

Re: Newbie Question - Where to store application constants?

2014-02-17 Thread C. Kirby
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

Re: Newbie Question - Where to store application constants?

2014-02-19 Thread Mark Phillips
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