def generateRandomEntry(db): shorthand = "A" randomDate = DateUtils.randomDate(datetime.date(2013, 6, 1), datetime.date.today()) shorthand += "D" + randomDate.strftime("%d%m%y") shorthand += "G" + Glider.getRandomTrigraphOrCompNo(db) shorthand += "L" + Location.getRandomLocation(db)[:3] nFlights = randint(1,4); shorthand += "N" + str(nFlights) shorthand += "P" + str(randint(1,2)) shorthand += "T" for i in range(nFlights): shorthand += "%02d" % randint(3, 20) shorthand += random.choice("WA") shorthand = shorthand.upper() shorthand += "NRandom Notes " if random.choice([True, False]) else "" return shorthand