<s> from django . db import models <EOL> from account . models import User <EOL> from utils . models import RichTextField <EOL> class ProblemTag ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:30> ) <EOL> class Meta : <EOL> db_table = "<STR_LIT>" <EOL> class AbstractProblem ( models . Model ) : <EOL> title = models . CharField ( max_length = <NUM_LIT:50> ) <EOL> description = RichTextField ( ) <EOL> input_description = models . CharField ( max_length = <NUM_LIT> ) <EOL> output_description = models . CharField ( max_length = <NUM_LIT> ) <EOL> samples = models . TextField ( blank = True ) <EOL> test_case_id = models . CharField ( max_length = <NUM_LIT> ) <EOL> hint = RichTextField ( blank = True , null = True ) <EOL> create_time = models . DateTimeField ( auto_now_add = True ) <EOL> last_update_time = models . DateTimeField ( blank = True , null = True ) <EOL> created_by = models . ForeignKey ( User ) <EOL> time_limit = models . IntegerField ( ) <EOL> memory_limit = models . IntegerField ( ) <EOL> spj = models . BooleanField ( default = False ) <EOL> spj_language = models . IntegerField ( blank = True , null = True ) <EOL> spj_code = models . TextField ( blank = True , null = True ) <EOL> spj_version = models . CharField ( max_length = <NUM_LIT:32> , blank = True , null = True ) <EOL> visible = models . BooleanField ( default = True ) <EOL> total_submit_number = models . IntegerField ( default = <NUM_LIT:0> ) <EOL> total_accepted_number = models . IntegerField ( default = <NUM_LIT:0> ) <EOL> class Meta : <EOL> db_table = "<STR_LIT>" <EOL> abstract = True <EOL> def add_submission_number ( self ) : <EOL> self . total_submit_number += <NUM_LIT:1> <EOL> self . save ( update_fields = [ "<STR_LIT>" ] ) <EOL> def add_ac_number ( self ) : <EOL> self . total_accepted_number += <NUM_LIT:1> <EOL> self . save ( update_fields = [ "<STR_LIT>" ] ) <EOL> class Problem ( AbstractProblem ) : <EOL> difficulty = models . IntegerField ( ) <EOL> tags = models . ManyToManyField ( ProblemTag ) <EOL> source = models . CharField ( max_length = <NUM_LIT:200> , blank = True , null = True ) </s>
