from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range ) author = 'Your name here' doc = """ Your app description """ class Constants(BaseConstants): name_in_url = 'bangla_st2_2_BNG_tr2_t0' players_per_group = 10 num_rounds = 1 # understanding check data #Todo: randomise this class Subsession(BaseSubsession): def before_session_starts(self): for p in self.get_players(): p.participant.vars['next_match'] = None p.participant.vars['next_role'] = None p.participant.vars['this_uid'] = None def creating_session(self): self.session.vars['app2_initialised'] = False def on_app_start(self): import random, json # Only run for first player if self.session.vars['app2_initialised'] == True: return None self.session.vars['app2_initialised'] = True print('[MAIN]\t\tInitialising App 2...') #Iterate round count forward self.session.vars['megaRound'] += 1 for p in self.get_players(): p.quality1 = p.participant.vars['ability1'] p.quality2 = p.participant.vars['ability2'] # Randomise to get distorted signals for p.distort_quality1 = random.randint( int(p.quality1 * 100 - 10),int(p.quality1 * 100 + 10 ) ) / 100 p.distort_quality2 = random.randint( int(p.quality2 * 100 - 10),int(p.quality2 * 100 + 10 ) ) / 100 p.distort_quality1 = min(1, p.distort_quality1) p.distort_quality1 = max(0, p.distort_quality1) p.distort_quality2 = min(1, p.distort_quality2) p.distort_quality2 = max(0, p.distort_quality2) #Todo: Move this to St0 p.uid = random.randint(1000,9999) if self.session.vars['treatment'] in [1,2]: p.display_quality1 = str( int( round(p.quality1 * 100,0 ) ) ) + "%" p.display_quality2 = str( int( round(p.quality2 * 100, 0 ) ) ) + "%" elif self.session.vars['treatment'] in [3,4]: p.display_quality1 = str( int( round(p.distort_quality1 * 100,0 ) ) ) + "%" p.display_quality2 = str( int( round(p.distort_quality2 * 100,0 ) ) ) + "%" # Store parameters for simulation/understanding test: simulation_self_skills = [round(random.randint(0,100) / 100, 2), round(random.randint(0,100) / 100, 2)] simulation_player_skills = [ [round(random.randint(0,100) / 100, 2), round(random.randint(0,100) / 100, 2), random.randint(1000,9999)], [round(random.randint(0,100) / 100, 2), round(random.randint(0,100) / 100, 2), random.randint(1000,9999)], [round(random.randint(0,100) / 100, 2), round(random.randint(0,100) / 100, 2), random.randint(1000,9999)], ] #Create network showing who the other playeyrs are for p in self.get_players(): others = {} # {order : uid} iter = 1 for pp in self.get_players(): if p.uid != pp.uid: others[iter] = pp.uid iter += 1 p.otherPlayers = json.dumps(others) # Store parameters for simulation/understanding test: p.self_underst_params = json.dumps(simulation_self_skills) p.others_underst_params = json.dumps(simulation_player_skills) def create_matching(self): import random, json players = [p for p in self.get_players()] matches = [] # [[uid1, uid2], [role1, role2]] matched_players = [] random.shuffle(players) print('[MAIN]\t\tCreating Ranking...') print("RSD says:", [p.uid for p in players]) # ATTENTION: Players can be matched-to even if have no pref bc RSD! for p in players: if p in matched_players: continue this_ranking = p.get_pref_list() # [other_players[i-1].uid, this_pref, this_role ] print("Player prefs:", p.uid, this_ranking) # go through ranking of this player, starting with top choice for op in this_ranking: # if other player not matched and player self not matched if op[0] not in matched_players and p.uid not in matched_players: # mark player as blocked matched_players.append( op[0] ) matched_players.append( p.uid ) # create match object this_match = [[p.uid, op[0]], [None, None] ] # Assign roles: # If player next in charge is indifferent, randomise and balance if op[2] == 0: this_match[1][0] = random.randint(1,2) if this_match[1][0] == 1: this_match[1][1] = 2 else: this_match[1][1] = 1 # I want the other person to take on role 1; I do role 2 elif op[2] == 1: this_match[1][1] = 1 this_match[1][0] = 2 # I want the other person to take on role 2; I do role 1 elif op[2] == 2: this_match[1][1] = 2 this_match[1][0] = 1 matches.append(this_match) # stop iterating over other players, bc. match already found for this one break else: pass #print(matches, matched_players) #print("Matching result:", matches) self.session.vars['allMatches'] = matches for p in self.get_players(): # Deposit matches for all players p.allMatches = json.dumps(matches) # Default: unmatched p.matchedTo = -1 if p.unmatchPref == 0: p.myRole = random.randint(1,2) else: p.myRole = p.unmatchPref # Read myRole and matchedTo for each player to migrate into next App for p in self.get_players(): # m = [[id1, id2], [role1, role2] ] for m in matches: if m[0][0] == p.uid and p.matchedTo == -1: p.matchedTo = m[0][1] p.myRole = m[1][0] elif m[0][1] == p.uid and p.matchedTo == -1: p.matchedTo = m[0][0] p.myRole = m[1][1] for p in self.get_players(): p.participant.vars['this_uid'] = p.uid p.participant.vars['matchedTo'] = p.matchedTo p.participant.vars['myRole'] = p.myRole p.participant.vars['unmatchPref'] = p.unmatchPref print("Match formed:\t", p.uid, p.matchedTo, p.myRole) def migrate_to_session(self): # move all relevant subsession variables to the session level to keep info on app switch #print('[MAIN]\t\tMigrating App2 variables') import json #Load in matches data from database for p in self.get_players(): matches = json.loads(p.allMatches) break # ! # ! # ! # SUBSESSION -> SESSION self.session.vars['allMatches'] = matches # send email def back_up(self): if self.session.vars['do_backups'] == False: return None import smtplib, ssl, time, json this_savepoint_id = 'svpt0201' save_data = [] for p in self.get_players(): this_row = [] # save metadata: date, player uid, player otree id, this_app this_row.append( time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime()) ) this_row.append(p.uid) this_row.append( p.participant.id_in_session ) this_row.append( p.participant.code ) this_row.append('app2') # save content: this_row.append([ p.participant.vars['prefsPlayers'], p.participant.vars['next_match'], p.participant.vars['next_role'] ]) save_data.append(this_row) save_data.append([ self.session.vars['allMatches'], self.session.vars['megaRound'] ]) try: this_dat = json.dumps(save_data) message = str(this_savepoint_id) + "\n " + this_dat from_address = "bangladeshi.experimentor@gmail.com" password = "YcDjgzQv44JD9a6R" context = ssl.create_default_context() with smtplib.SMTP_SSL("smtp.gmail.com", 465, context=context) as server: server.login(from_address, password) server.sendmail( from_address, "bangladeshi.experimentor@gmail.com", message) except: print("ERR message not sent") class Group(BaseGroup): pass class Player(BasePlayer): def make_fields( label): #choice_set = list(range(0, Constants.players_per_group)) choice_set = [ [i, str(i)] for i in range(0, Constants.players_per_group)] for c in range(len(choice_set)): if choice_set[c][0] == 0: choice_set[c][1] = "No Match" print("choice set", choice_set) pfield = models.IntegerField( choices=choice_set, label="" , initial=0) rfield = models.IntegerField( choices=[ [0, "Any"], [1, "English"], [2, "Design"] ], label="", initial=0 ) return pfield, rfield def get_pref_list(self): import json this_prefs = json.loads(self.prefsPlayers) this_prefs = list(this_prefs.values()) # drop 0-pref markers this_prefs = [ pr for pr in this_prefs if pr[1]!=0 ] this_prefs.sort(key=lambda x: x[1]) #sort by second element, is last pref this_prefs = tuple( this_prefs ) return this_prefs # ( [other_players[i-1].uid, this_pref, this_role ] ) uid = models.IntegerField() #ability1 = models.FloatField() #ability2 = models.FloatField() # This is being displayed in the selection menu quality1 = models.FloatField() quality2 = models.FloatField() distort_quality1 = models.FloatField() distort_quality2 = models.FloatField() display_quality1 = models.StringField() display_quality2 = models.StringField() otherPlayers = models.StringField() prefsPlayers = models.StringField() allMatches = models.StringField() matchedTo = models.IntegerField(initial=0) myRole = models.IntegerField() unmatchPref = models.IntegerField( choices=[ [0, 'Any'],[1, 'English'],[2, 'Design']],label='', initial=0) # For check whether have understood the game p_answer_undst_1 = models.IntegerField(choices=[[0, 'No Match'],[1, '1'],[2, '2'],[3, '3'],[4, '4']], label='' ,initial=0) p_answer_undst_2 = models.IntegerField(choices=[[0, 'No Match'],[1, '1'],[2, '2'],[3, '3'],[4, '4']], label='' ,initial=0) p_answer_undst_3 = models.IntegerField(choices=[[0, 'No Match'],[1, '1'],[2, '2'],[3, '3'],[4, '4']], label='' ,initial=0) p_answer_undst_4 = models.IntegerField(choices=[[0, 'No Match'],[1, '1'],[2, '2'],[3, '3'],[4, '4']], label='' ,initial=0) r_answer_undst_1 = models.IntegerField( choices=[ [0, 'Any'],[1, 'English'],[2, 'Design']],label='', initial=0) r_answer_undst_2 = models.IntegerField( choices=[ [0, 'Any'],[1, 'English'],[2, 'Design']],label='', initial=0) r_answer_undst_3 = models.IntegerField( choices=[ [0, 'Any'],[1, 'English'],[2, 'Design']],label='', initial=0) r_answer_undst_4 = models.IntegerField( choices=[ [0, 'Any'],[1, 'English'],[2, 'Design']],label='', initial=0) #Understanding parameters self_underst_params = models.StringField() others_underst_params = models.StringField() if Constants.players_per_group == 10: pfield1 = models.IntegerField( choices=[[0, 'No Match'], [1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7'], [8, '8'], [9, '9']], label='' ,initial=0) rfield1 = models.IntegerField( choices=[ [0, 'Any'],[1, 'English'],[2, 'Design']],label='', initial=0) pfield2 = models.IntegerField( choices=[[0, 'No Match'], [1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7'], [8, '8'], [9, '9']], label='' ,initial=0) rfield2 = models.IntegerField( choices=[ [0, 'Any'],[1, 'English'],[2, 'Design']],label='', initial=0) pfield3 = models.IntegerField( choices=[[0, 'No Match'], [1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7'], [8, '8'], [9, '9']], label='' ,initial=0) rfield3 = models.IntegerField( choices=[ [0, 'Any'],[1, 'English'],[2, 'Design']],label='', initial=0) pfield4 = models.IntegerField( choices=[[0, 'No Match'], [1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7'], [8, '8'], [9, '9']], label='' ,initial=0) rfield4 = models.IntegerField( choices=[ [0, 'Any'],[1, 'English'],[2, 'Design']],label='', initial=0) pfield5 = models.IntegerField( choices=[[0, 'No Match'], [1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7'], [8, '8'], [9, '9']], label='' ,initial=0) rfield5 = models.IntegerField( choices=[ [0, 'Any'],[1, 'English'],[2, 'Design']],label='', initial=0) pfield6 = models.IntegerField( choices=[[0, 'No Match'], [1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7'], [8, '8'], [9, '9']], label='' ,initial=0) rfield6 = models.IntegerField( choices=[ [0, 'Any'],[1, 'English'],[2, 'Design']],label='', initial=0) pfield7 = models.IntegerField( choices=[[0, 'No Match'], [1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7'], [8, '8'], [9, '9']], label='' ,initial=0) rfield7 = models.IntegerField( choices=[ [0, 'Any'],[1, 'English'],[2, 'Design']],label='', initial=0) pfield8 = models.IntegerField( choices=[[0, 'No Match'], [1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7'], [8, '8'], [9, '9']], label='' ,initial=0) rfield8 = models.IntegerField( choices=[ [0, 'Any'],[1, 'English'],[2, 'Design']],label='', initial=0) pfield9 = models.IntegerField( choices=[[0, 'No Match'], [1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7'], [8, '8'], [9, '9']], label='' ,initial=0) rfield9 = models.IntegerField( choices=[ [0, 'Any'],[1, 'English'],[2, 'Design']],label='', initial=0) else: global iiter for iiter in range(1, Constants.players_per_group ): exec("pfield%s, rfield%s = make_fields(%s)" % (iiter, iiter, iiter) ) # 2) make questions # - hue order # - color select # - select sans-serif # - draw rectangle (low prio) #Post pilot: #Do: # # # # # # # # Fr: # # # # # # # # Sat: # Check that data being fully stored: score progression, performance in each round! # prepare stata checks - way to "validate" data immediately # Stata questions: # - earnings; performance; score progression over time # - error rate on questions / ability # - ability vs. avg. performance # - ability X ability scatter with marking for matched or not # - matching rate # - earnings by match # - ability vs. prob of getting the role # - confirm maths # Verify calibration maths - same approx. expected revenue for bank; footing in literature # Confirm that production function and payoff maths work as intended (theory and practice) # adjust point rate(ALSO IN TEXT) # # # # # # # # # # Small things: # better display of instructions (incl. formula) # small timers on some pages to speed up rund progression # randomise player matching in match select # Priming box for uncert treatment during match select! # 500 points in verbquiresult app 3 - make dynamic! # Scramble magnitude - switch to 15? # Dynamic thaka rate in display!! # fINALISE / expand questions # POST PILOT 2: # Stata eval: # Are people understanding the questions? # Are people getting matched? # Are people earning more when matched? # Score progression? # part IDs clear assignment clear? # Maths confirm that work out (in real and in program): optimiing choice?, check equivalence for bank at given performance # All data being recorded? # Final round of translations # Give basic info on how RSD works? # # # # # # MAKE SHORTER / ID RECORD IN test as welll # Randomize questions by player # sort out flow of mega vars: , participant count, date of session; create log for session stage success, # performance in each mega-period # merge migration and backup # --> directory issues with backup # Issue? django.db.utils.OperationalError: database is locked # Exception: Another HTTP request has the lock for participant # system for invitations # players_per_group = 20 # # for iiter in range(1, players_per_group ): # #exec("pfield%s, rfield%s = make_fields(%s)" % (iiter, iiter, iiter) ) # # choice_set = [ [i, str(i)] for i in range(0, players_per_group)] # for c in range(len(choice_set)): # if choice_set[c][0] == 0: # choice_set[c][1] = "No Match" # # print( "pfield"+str(iiter)+" = models.IntegerField( choices="+str(choice_set)+", label='' ,initial=0)" ) # print( "rfield"+str(iiter)+" = models.IntegerField( choices=[ [0, 'Any'],[1, 'English'],[2, 'Design']],label='', initial=0)") ### pfield1 = models.IntegerField( choices=[[0, 'No Match'], [1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7'], [8, '8'], [9, '9'], [10, '10'], [11, '11'], [12, '12'], [13, '13'], [14, '14'], [15, '15'], [16, '16'], [17, '17'], [18, '18'], [19, '19']], label='' ,initial=0) # rfield1 = models.IntegerField( choices=[ [0, 'Any'],[1, 'English'],[2, 'Design']],label='', initial=0) # pfield2 = models.IntegerField( choices=[[0, 'No Match'], [1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7'], [8, '8'], [9, '9'], [10, '10'], [11, '11'], [12, '12'], [13, '13'], [14, '14'], [15, '15'], [16, '16'], [17, '17'], [18, '18'], [19, '19']], label='' ,initial=0) # rfield2 = models.IntegerField( choices=[ [0, 'Any'],[1, 'English'],[2, 'Design']],label='', initial=0) # pfield3 = models.IntegerField( choices=[[0, 'No Match'], [1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7'], [8, '8'], [9, '9'], [10, '10'], [11, '11'], [12, '12'], [13, '13'], [14, '14'], [15, '15'], [16, '16'], [17, '17'], [18, '18'], [19, '19']], label='' ,initial=0) # rfield3 = models.IntegerField( choices=[ [0, 'Any'],[1, 'English'],[2, 'Design']],label='', initial=0) # pfield4 = models.IntegerField( choices=[[0, 'No Match'], [1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7'], [8, '8'], [9, '9'], [10, '10'], [11, '11'], [12, '12'], [13, '13'], [14, '14'], [15, '15'], [16, '16'], [17, '17'], [18, '18'], [19, '19']], label='' ,initial=0) # rfield4 = models.IntegerField( choices=[ [0, 'Any'],[1, 'English'],[2, 'Design']],label='', initial=0) # pfield5 = models.IntegerField( choices=[[0, 'No Match'], [1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7'], [8, '8'], [9, '9'], [10, '10'], [11, '11'], [12, '12'], [13, '13'], [14, '14'], [15, '15'], [16, '16'], [17, '17'], [18, '18'], [19, '19']], label='' ,initial=0) # rfield5 = models.IntegerField( choices=[ [0, 'Any'],[1, 'English'],[2, 'Design']],label='', initial=0) # pfield6 = models.IntegerField( choices=[[0, 'No Match'], [1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7'], [8, '8'], [9, '9'], [10, '10'], [11, '11'], [12, '12'], [13, '13'], [14, '14'], [15, '15'], [16, '16'], [17, '17'], [18, '18'], [19, '19']], label='' ,initial=0) # rfield6 = models.IntegerField( choices=[ [0, 'Any'],[1, 'English'],[2, 'Design']],label='', initial=0) # pfield7 = models.IntegerField( choices=[[0, 'No Match'], [1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7'], [8, '8'], [9, '9'], [10, '10'], [11, '11'], [12, '12'], [13, '13'], [14, '14'], [15, '15'], [16, '16'], [17, '17'], [18, '18'], [19, '19']], label='' ,initial=0) # rfield7 = models.IntegerField( choices=[ [0, 'Any'],[1, 'English'],[2, 'Design']],label='', initial=0) # pfield8 = models.IntegerField( choices=[[0, 'No Match'], [1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7'], [8, '8'], [9, '9'], [10, '10'], [11, '11'], [12, '12'], [13, '13'], [14, '14'], [15, '15'], [16, '16'], [17, '17'], [18, '18'], [19, '19']], label='' ,initial=0) # rfield8 = models.IntegerField( choices=[ [0, 'Any'],[1, 'English'],[2, 'Design']],label='', initial=0) # pfield9 = models.IntegerField( choices=[[0, 'No Match'], [1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7'], [8, '8'], [9, '9'], [10, '10'], [11, '11'], [12, '12'], [13, '13'], [14, '14'], [15, '15'], [16, '16'], [17, '17'], [18, '18'], [19, '19']], label='' ,initial=0) # rfield9 = models.IntegerField( choices=[ [0, 'Any'],[1, 'English'],[2, 'Design']],label='', initial=0) # pfield10 = models.IntegerField( choices=[[0, 'No Match'], [1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7'], [8, '8'], [9, '9'], [10, '10'], [11, '11'], [12, '12'], [13, '13'], [14, '14'], [15, '15'], [16, '16'], [17, '17'], [18, '18'], [19, '19']], label='' ,initial=0) # rfield10 = models.IntegerField( choices=[ [0, 'Any'],[1, 'English'],[2, 'Design']],label='', initial=0) # pfield11 = models.IntegerField( choices=[[0, 'No Match'], [1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7'], [8, '8'], [9, '9'], [10, '10'], [11, '11'], [12, '12'], [13, '13'], [14, '14'], [15, '15'], [16, '16'], [17, '17'], [18, '18'], [19, '19']], label='' ,initial=0) # rfield11 = models.IntegerField( choices=[ [0, 'Any'],[1, 'English'],[2, 'Design']],label='', initial=0) # pfield12 = models.IntegerField( choices=[[0, 'No Match'], [1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7'], [8, '8'], [9, '9'], [10, '10'], [11, '11'], [12, '12'], [13, '13'], [14, '14'], [15, '15'], [16, '16'], [17, '17'], [18, '18'], [19, '19']], label='' ,initial=0) # rfield12 = models.IntegerField( choices=[ [0, 'Any'],[1, 'English'],[2, 'Design']],label='', initial=0) # pfield13 = models.IntegerField( choices=[[0, 'No Match'], [1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7'], [8, '8'], [9, '9'], [10, '10'], [11, '11'], [12, '12'], [13, '13'], [14, '14'], [15, '15'], [16, '16'], [17, '17'], [18, '18'], [19, '19']], label='' ,initial=0) # rfield13 = models.IntegerField( choices=[ [0, 'Any'],[1, 'English'],[2, 'Design']],label='', initial=0) # pfield14 = models.IntegerField( choices=[[0, 'No Match'], [1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7'], [8, '8'], [9, '9'], [10, '10'], [11, '11'], [12, '12'], [13, '13'], [14, '14'], [15, '15'], [16, '16'], [17, '17'], [18, '18'], [19, '19']], label='' ,initial=0) # rfield14 = models.IntegerField( choices=[ [0, 'Any'],[1, 'English'],[2, 'Design']],label='', initial=0) # pfield15 = models.IntegerField( choices=[[0, 'No Match'], [1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7'], [8, '8'], [9, '9'], [10, '10'], [11, '11'], [12, '12'], [13, '13'], [14, '14'], [15, '15'], [16, '16'], [17, '17'], [18, '18'], [19, '19']], label='' ,initial=0) # rfield15 = models.IntegerField( choices=[ [0, 'Any'],[1, 'English'],[2, 'Design']],label='', initial=0) # pfield16 = models.IntegerField( choices=[[0, 'No Match'], [1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7'], [8, '8'], [9, '9'], [10, '10'], [11, '11'], [12, '12'], [13, '13'], [14, '14'], [15, '15'], [16, '16'], [17, '17'], [18, '18'], [19, '19']], label='' ,initial=0) # rfield16 = models.IntegerField( choices=[ [0, 'Any'],[1, 'English'],[2, 'Design']],label='', initial=0) # pfield17 = models.IntegerField( choices=[[0, 'No Match'], [1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7'], [8, '8'], [9, '9'], [10, '10'], [11, '11'], [12, '12'], [13, '13'], [14, '14'], [15, '15'], [16, '16'], [17, '17'], [18, '18'], [19, '19']], label='' ,initial=0) # rfield17 = models.IntegerField( choices=[ [0, 'Any'],[1, 'English'],[2, 'Design']],label='', initial=0) # pfield18 = models.IntegerField( choices=[[0, 'No Match'], [1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7'], [8, '8'], [9, '9'], [10, '10'], [11, '11'], [12, '12'], [13, '13'], [14, '14'], [15, '15'], [16, '16'], [17, '17'], [18, '18'], [19, '19']], label='' ,initial=0) # rfield18 = models.IntegerField( choices=[ [0, 'Any'],[1, 'English'],[2, 'Design']],label='', initial=0) # pfield19 = models.IntegerField( choices=[[0, 'No Match'], [1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7'], [8, '8'], [9, '9'], [10, '10'], [11, '11'], [12, '12'], [13, '13'], [14, '14'], [15, '15'], [16, '16'], [17, '17'], [18, '18'], [19, '19']], label='' ,initial=0) # rfield19 = models.IntegerField( choices=[ [0, 'Any'],[1, 'English'],[2, 'Design']],label='', initial=0)