コード例 #1
0
ファイル: languages.py プロジェクト: echwa/bombolone
 def update(self):
     """ Saves which languages to use in web application """
     for code in LIST_LANGUAGES:
         if code != g.lan:
             if code in request.form and 'on' == request.form[code]:
                 check = True
             else:
                 check = False
             
             try:
                 # Update the permissions of the languages 
                 # and prepares the message of operation success
                 set_update = {'$set' : { 'check' : check } }
                 g.db.languages.update({'code' : code}, set_update )
                 self.message = g.languages_msg('success_update')	
                 self.status = 'msg msg-success'
             except PyMongoError:
                 self.message = g.languages_msg('error_mongo_update')
コード例 #2
0
ファイル: languages.py プロジェクト: leprecha1/bombolone
    def update(self):
        """ Saves which languages to use in web application """
        for code in LIST_LANGUAGES:
            if code != g.lan:
                if code in request.form and 'on' == request.form[code]:
                    check = True
                else:
                    check = False

                try:
                    # Update the permissions of the languages
                    # and prepares the message of operation success
                    set_update = {'$set': {'check': check}}
                    g.db.languages.update({'code': code}, set_update)
                    self.message = g.languages_msg('success_update')
                    self.status = 'msg msg-success'
                except PyMongoError:
                    self.message = g.languages_msg('error_mongo_update')
コード例 #3
0
ファイル: languages.py プロジェクト: Goku0858756/bombolone
 def update(self):
     """Saves which languages to use in web application."""
     for code in LIST_LANGUAGES:
         if code != g.lang:
             if code in request.form and 'on' == request.form[code]:
                 check = True
             else:
                 check = False
             language = bombolone.model.languages.find(code=code, only_one=True)
             bombolone.model.languages.update(language_id=language['_id'], check=check)
             self.message = g.languages_msg('success_update')
             self.status = 'msg msg-success'
コード例 #4
0
ファイル: languages.py プロジェクト: zchking/bombolone
 def update(self):
     """Saves which languages to use in web application."""
     for code in LIST_LANGUAGES:
         if code != g.lang:
             if code in request.form and 'on' == request.form[code]:
                 check = True
             else:
                 check = False
             language = model.languages.find(code=code, only_one=True)
             model.languages.update(language_id=language['_id'],
                                    check=check)
             self.message = g.languages_msg('success_update')
             self.status = 'msg msg-success'
コード例 #5
0
ファイル: languages.py プロジェクト: cash2one/Bombolone
 def update(self):
     """ Saves which languages to use in web application """
     for code in LIST_LANGUAGES:
         if code != g.lang:
             if code in request.form and 'on' == request.form[code]:
                 check = True
             else:
                 check = False
             # Update the permissions of the languages
             # and prepares the message of operation success
             set_update = {'$set': {'check': check}}
             model.languages.update(code=code, lanugage=set_update)
             self.message = g.languages_msg('success_update')
             self.status = 'msg msg-success'
コード例 #6
0
ファイル: languages.py プロジェクト: capezzbr/bombolone
 def update(self):
     """ Saves which languages to use in web application """
     for code in LIST_LANGUAGES:
         if code != g.lang:
             if code in request.form and 'on' == request.form[code]:
                 check = True
             else:
                 check = False
             # Update the permissions of the languages
             # and prepares the message of operation success
             set_update = {'$set' : { 'check' : check } }
             model.languages.update(code=code, 
                                    lanugage=set_update)
             self.message = g.languages_msg('success_update')
             self.status = 'msg msg-success'