Пример #1
0
def store_config_value(key, value):
    try:
        setting = ConfigSetting.objects.get(key=key)
    except ObjectDoesNotExist:
        setting = ConfigSetting()
        setting.key = key

    setting.value = value
    setting.save()
    refresh()
Пример #2
0
def store_config_value(key, value):
    try:
        setting = ConfigSetting.objects.get(key=key)
    except ObjectDoesNotExist:
        setting = ConfigSetting()
        setting.key = key

    setting.value = value
    setting.save()
    refresh()
Пример #3
0
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with StratoSource.  If not, see <http://www.gnu.org/licenses/>.
#    
from stratosource.admin.models import ConfigSetting
from django.core.exceptions import ObjectDoesNotExist

STANDARDCHKSETTINGS='rally.enabled'
STANDARDTXTSETTINGS='rally.login,email.host,email.from'
STANDARDPASSWORDS='rally.password'

for name in STANDARDTXTSETTINGS.split(','):
  s = ConfigSetting(key=name, value='', allow_delete=False, masked=False)
  s.save()

for name in STANDARDCHKSETTINGS.split(','):
  s = ConfigSetting(key=name, value='', type='check', allow_delete=False, masked=False)
  s.save()

for name in STANDARDPASSWORDS.split(','):
  s = ConfigSetting(key=name, value='', allow_delete=False, masked=True)
  s.save()

#try:
#    unReleased = Release.objects.get(name='Unreleased')
#    unReleased.name = 'Unreleased'
#    unReleased.hidden = True
#    unReleased.isdefault = True
Пример #4
0
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with StratoSource.  If not, see <http://www.gnu.org/licenses/>.
#
from stratosource.admin.models import ConfigSetting
from django.core.exceptions import ObjectDoesNotExist
import uuid

STANDARDCHKSETTINGS = 'rally.enabled,agilezen.enabled'
STANDARDTXTSETTINGS = 'rally.login,email.host,email.from'
STANDARDPASSWORDS = 'rally.password,agilezen.apikey'

s = ConfigSetting(key='calendar.host',
                  value='localhost',
                  allow_delete=False,
                  masked=False)
s.save()
s = ConfigSetting(key='uuid',
                  value=uuid.uuid1(),
                  allow_delete=False,
                  masked=False)
s.save()

for name in STANDARDTXTSETTINGS.split(','):
    s = ConfigSetting(key=name, value='', allow_delete=False, masked=False)
    s.save()

for name in STANDARDCHKSETTINGS.split(','):
    s = ConfigSetting(key=name,
                      value='',
Пример #5
0
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with StratoSource.  If not, see <http://www.gnu.org/licenses/>.
#
from stratosource.admin.models import ConfigSetting
from django.core.exceptions import ObjectDoesNotExist

STANDARDCHKSETTINGS = 'rally.enabled'
STANDARDTXTSETTINGS = 'rally.login,email.host,email.from'
STANDARDPASSWORDS = 'rally.password'

for name in STANDARDTXTSETTINGS.split(','):
    s = ConfigSetting(key=name, value='', allow_delete=False, masked=False)
    s.save()

for name in STANDARDCHKSETTINGS.split(','):
    s = ConfigSetting(key=name,
                      value='',
                      type='check',
                      allow_delete=False,
                      masked=False)
    s.save()

for name in STANDARDPASSWORDS.split(','):
    s = ConfigSetting(key=name, value='', allow_delete=False, masked=True)
    s.save()

#try: