def forge(self, session, basetime, date, **kwargs): self.Title = gen_random_text(2,5,True) self.Description = 'Product Description Omitted' self.Vendor_ID = random.randint(1000, 100000) self.Category = random.choice(['Aeronautics', 'Pets', 'Farming', 'Sports', 'Literature']) self.MSRP = random.randint(1, 200) self.Reseller_Price = self.MSRP - (self.MSRP * 0.20) self.Weight = random.randint(1, 100) self.UPC_CODE = random.randint(1000000, 9999999) self.upid = random.choice(['A', 'B', 'C', 'D','E','F','G']) self.Availability = random.choice(['0','1']) self.Rating = random.choice(['0','1','1','2','2','2','3','3','3','3','3','3','4','4','4','4','5','5','5']) self.Reviews = random.randint(0, 400) self.Created_Date = date self.Updated_Date = date + datetime.timedelta(days=random.randint(7, 48))
def forge(self, session, date=None, basetime=None): self.text = gen_random_text() self.public = (random.randint(0, 8) == 2) self.source = random.choice(['web', 'email', 'email', 'email', 'web', 'mobile', 'chat', 'api']) self.commenter_id = get_random(User, session, basetime=basetime) self.ticket_id = get_random(Ticket, session, basetime=basetime)