Exemplo n.º 1
0
    def post(self):

        cf = self.cf
        saved = None

        form = DBForm( self.request.arguments )
        if form.validate():
            cf.set('db', 'db_host', form.dbhost.data)
            cf.set('db', 'db_type', form.dbtype.data)
            cf.set('db', 'db_name', form.dbname.data)
            cf.set('db', 'db_user', form.dbuser.data)
            cf.set('db', 'db_password', form.dbpass.data)
            cf.write(open(settings.LUOYUN_CONFIG_PATH, 'w'))
            saved = True
            # TODO: Important ! db settings should check for connect !

        self.render('system/db_edit.html', form=form, saved = saved)
Exemplo n.º 2
0
    def post(self):

        cf = self.cf
        saved = None

        form = DBForm(self)
        if form.validate():
            cf.set('db_host', form.dbhost.data)
            cf.set('db_type', form.dbtype.data)
            cf.set('db_name', form.dbname.data)
            cf.set('db_user', form.dbuser.data)
            cf.set('db_password', form.dbpass.data)
            cf.save()
            saved = True
            # TODO: Important ! db settings should check for connect !

        self.render('system/db_edit.html', form=form, saved = saved)
Exemplo n.º 3
0
    def post(self):

        cf = self.cf
        saved = None

        form = DBForm(self)
        if form.validate():
            cf.set('db_host', form.dbhost.data)
            cf.set('db_type', form.dbtype.data)
            cf.set('db_name', form.dbname.data)
            cf.set('db_user', form.dbuser.data)
            cf.set('db_password', form.dbpass.data)
            cf.save()
            saved = True
            # TODO: Important ! db settings should check for connect !

        self.render('system/db_edit.html', form=form, saved=saved)
Exemplo n.º 4
0
    def post(self):

        cf = self.cf
        saved = None

        form = DBForm(self.request.arguments)
        if form.validate():
            cf.set('db', 'db_host', form.dbhost.data)
            cf.set('db', 'db_type', form.dbtype.data)
            cf.set('db', 'db_name', form.dbname.data)
            cf.set('db', 'db_user', form.dbuser.data)
            cf.set('db', 'db_password', form.dbpass.data)
            cf.write(open(settings.LUOYUN_CONFIG_PATH, 'w'))
            saved = True
            # TODO: Important ! db settings should check for connect !

        self.render('system/db_edit.html', form=form, saved=saved)
Exemplo n.º 5
0
    def get(self):

        cf = self.cf

        form = DBForm(self)
        try:
            form.dbname.data = cf.get('db_name')
            form.dbuser.data = cf.get('db_user')
            form.dbpass.data = cf.get('db_password')
            form.dbhost.data = cf.get('db_host')
            form.dbtype.data = cf.get('db_type')
        except:
            pass

        self.render('system/db_edit.html', form=form)