Thursday, August 28, 2014

Re: Constants values and best practices

Hi Julian,

I think there are a couple options.

The easiest would be to store the constants as Python. I would recommend using the choices field, as detailed by the documentation:

https://docs.djangoproject.com/en/1.7/ref/models/fields/#choices

If you must store your constants as part of the database, and would like to keep the constants up to date across multiple databases/developers, you should look into data migrations. South provides them, as do the new migrations in Django 1.7 (I believe).

http://south.readthedocs.org/en/latest/tutorial/part3.html

Hope that helps,
Andrew

--
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/7E584188-D6CB-46C9-ABC1-C0E64B2D23FA%40andrewsforge.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment