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.
In the Estimate model, I have a field for weight, and then a property that
looks something like:
@property
def estimate_by_weight():
return self.weight * PRICE_OF GOLD
Where would I put the PRICE_OF_GOLD constant? Some ideas that came to mind:
1. Settings.py - but then I have to edit that file every time I want to
update the price of gold
2. Maybe a model so I can update it in the admin screens?
3. A form somewhere? But I think this would mean a model, so this is
probably the same as #2.
Where would one put a non-changing constant like the speed of light in a
django application?
Thanks!
Mark
(1) Yes, I realize that terms 'constant' and 'changes sometimes' are
mutually exclusive, but I hope you get the gist of what I am asking
regardless of my imprecise description..
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/CAEqej2OuRC%3D5c2AwKkLRV0%2BGQJMBd6g2wM41mRZB1RCpMtOshw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.