user@mac ~ $ test_value="awdaDWAD" python
Python 2.7.10 (default, Oct 23 2015, 19:19:21)
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> print os.getenv('test_value')
awdaDWAD
def year_func(*args):
res = ()
for year in range(args[0], args[1]):
res += ((str(year), str(year)),)
return res
class ModelName(models.Model):
year = models.CharField(max_length=50, choices=year_func(1990, 2000), verbose_name='год')