--> --> -->
 
 
KeyError
Python 2.4.3: /usr/bin/python
Thu Jul 24 14:19:21 2014

A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.

 /home/performa/public_html/cgi-bin/pfi_upcoming.py
  325                 
  326 
  327 
  328 if __name__ == '__main__':
  329     main()
main = <function main>
 /home/performa/public_html/cgi-bin/pfi_upcoming.py in main()
   22         body = all_courses(db)
   23     else:
   24         body = one_course(db, int(course_id), int(level_id))
   25     
   26     db.close()
body undefined, global one_course = <function one_course>, db = <_mysql.connection open to 'localhost' at 754f70>, builtin int = <type 'int'>, course_id = '453', level_id = '2'
 /home/performa/public_html/cgi-bin/pfi_upcoming.py in one_course(db=<_mysql.connection open to 'localhost' at 754f70>, course_id=453, level_id=2)
  139 
  140     # Write it up in a webpage
  141     if course_info['variant']:
  142         variant = ' (%s)' % course_info['variant']
  143     else:
course_info = <pfi_utils.CourseInfo instance>
 /home/performa/public_html/cgi-bin/pfi_utils.py in __getitem__(self=<pfi_utils.CourseInfo instance>, key='variant')
  188     # Most info can be accessed as a dictionary
  189     def __getitem__(self, key):
  190         return self.course_dict[key]
  191 
  192     # Useful for checking if the init function found the course in the database
self = <pfi_utils.CourseInfo instance>, self.course_dict = {'capacity': 10L, 'city': 'Tampa', 'country': 'with PFI', 'currency': 'USD', 'date': 'October 27 - 30, 2012', 'end_date': datetime.date(2012, 10, 30), 'id': 453, 'is_full': 'N', 'level': 'Freediver', 'level_page': '/course-information/basic/', ...}, key = 'variant'

KeyError: 'variant'
      args = ('variant',)