Exemplo n.º 1
0
 def save(self, commit=True):
     user = User()
     user.username = self.cleaned_data["username"]
     user.set_password(self.cleaned_data["password1"])
     session = Session()
     session.add(user)
     session.commit()
     session.close()
     return user
Exemplo n.º 2
0
def update_last_login(sender, user, **kwargs):
    """
    A signal receiver which updates the last_login date for
    the user logging in.
    """
    user.last_login = timezone.now()
    session = Session()
    session.merge(user)
    session.commit()
    session.close()
Exemplo n.º 3
0
 def save(self, commit=True):
     input_output_data = InputOutputData() 
     input_output_data.problem_meta_id = self.cleaned_data['problem_meta_id']       
     input_output_data.name = self.cleaned_data['name']   
     
     session = Session()
     session.add(input_output_data)
     session.commit()
     session.close()
     
     return  input_output_data
Exemplo n.º 4
0
 def save(self, commit=True):
     problem_meta = ProblemMeta()
     problem_meta.title = self.cleaned_data['title']
     problem_meta.judge_flow = self.cleaned_data['judge_flow']
     
     session = Session()
     session.add(problem_meta)
     session.commit()
     session.close()
     
     return problem_meta
Exemplo n.º 5
0
 def save(self, commit=True):
     output_check_config = OutputCheckConfig() 
     output_check_config.problem_meta_id = self.cleaned_data['problem_meta_id']       
     output_check_config.check_method = self.cleaned_data['check_method']   
     
     session = Session()
     session.add(output_check_config)
     session.commit()
     session.close()
     
     return  output_check_config
Exemplo n.º 6
0
 def save(self, commit=True):
     compile_config = CompileConfig() 
     compile_config.problem_meta_id = self.cleaned_data['problem_meta_id']       
     compile_config.code_type = self.cleaned_data['code_type']
     compile_config.config = self.cleaned_data['config']        
     
     session = Session()
     session.add(compile_config)
     session.commit()
     session.close()
     
     return  compile_config
Exemplo n.º 7
0
 def save(self, commit=True):
     keyword_check_config = KeywordCheckConfig()
     #keyword_check_config.problem_meta_id = int(self.cleaned_data['problem_meta_id'][0])
     keyword_check_config.problem_meta_id = self.cleaned_data['problem_meta_id']
     keyword_check_config.code_type = self.cleaned_data['code_type']                
     keyword_check_config.word = self.cleaned_data['word']
     
     session = Session()
     session.add(keyword_check_config)
     session.commit()
     session.close()
     
     return  keyword_check_config
Exemplo n.º 8
0
 def save(self, commit=True):
     compilable_code_generation_config = CompilableCodeGenerationConfig() 
     compilable_code_generation_config.problem_meta_id = self.cleaned_data['problem_meta_id']       
     compilable_code_generation_config.code_type_id = self.cleaned_data['code_type_id']
     compilable_code_generation_config.generation_method = self.cleaned_data['generation_method']  
     compilable_code_generation_config.requirment = self.cleaned_data['requirment']      
     
     session = Session()
     session.add(compilable_code_generation_config)
     session.commit()
     session.close()
     
     return  compilable_code_generation_config  
Exemplo n.º 9
0
 def setter(raw_password):
     self.set_password(raw_password)
     session = Session()
     session.merge(self)
     session.commit()
     session.close()