def build_move_descriptions():
 for m in Move.objects.all():
  f_moves = open('data/moves.csv', 'rb')
  f_descrips = open('data/move_effects.csv', 'rb')
  for row in csv.reader(f_moves, delimiter=','):
   if (str(row[1]) == m.name):
    for drow in csv.reader(f_descrips, delimiter=','):
     if (str(row[10]) == str(drow[0])):
      s = str(drow[3]).replace('$effect_chance', str(row[11]))
      s = s.replace('[', '')
      s = s.replace(']', '')
      m.description = s
      m.save()
      print ('added description to %s' % m.name)

def build_move_descriptions ( ) : for m in Move . objects . all ( ) : f_moves = open ( 'data/moves.csv' , 'rb' ) f_descrips = open ( 'data/move_effects.csv' , 'rb' ) for row in csv . reader ( f_moves , delimiter = ',' ) : if ( str ( row [ 1 ] ) == m . name ) : for drow in csv . reader ( f_descrips , delimiter = ',' ) : if ( str ( row [ 10 ] ) == str ( drow [ 0 ] ) ) : s = str ( drow [ 3 ] ) . replace ( '$effect_chance' , str ( row [ 11 ] ) ) s = s . replace ( '[' , '' ) s = s . replace ( ']' , '' ) m . description = s m . save ( ) print ( 'added description to %s' % m . name )
build all the move descriptions .