docs: def insertDict(self, tblname, d, fields = None):
  		'''Simple function for inserting a dictionary whose keys match the fieldnames of tblname.'''
  		
  		if fields == None:
  			fields = sorted(d.keys())
  		values = None
  		try:
  			SQL = 'INSERT INTO %s (%s) VALUES (%s)' % (tblname, join(fields, ", "), join(['%s' for x in range(len(fields))], ','))
  			values = tuple([d[k] for k in fields])
  	 		self.locked_execute(SQL, parameters = values)
  		except Exception, e:
  			if SQL and values:
  				sys.stderr.write("\nSQL execution error in query '%s' %% %s at %s:" % (SQL, values, datetime.now().strftime("%Y-%m-%d %H:%M:%S")))
  			sys.stderr.write("\nError: '%s'.\n" % (str(e)))
  			sys.stderr.flush()
  			raise Exception("Error occurred during database insertion: '%s'." % str(e))