def saveInq(user, inquiry, authority): cnt = 0 now = datetime.datetime.now() year = str(now.year) month = str(now.month) date = str(now.day) if (len(month) != 2): month = "0" + month if (len(date) != 2): date = "0" + date rep_id = date + month + year if (authority == 1): rep_id = str(1) + rep_id if (authority == 2): rep_id = str(2) + rep_id authority = Authority.objects.filter(authority_id=int(authority)) auth = '' for a in authority: auth = a #get relevant report object report = Report.objects.filter(report_id=int(rep_id)) report_obj_for_save = '' for rep in report: cnt = 1 if (cnt == 0): report_obj = Report(report_id=int(rep_id), authority_id=auth) report_obj.save() report = Report.objects.filter(report_id=int(rep_id)) for rep_object in report: report_obj_for_save = rep_object #get relavant user object user_obj = User.objects.filter(username=user) user_for_save = '' for u in user_obj: user_for_save = u inquiry = str(inquiry).replace("<br>", "," + " ") inq = Inquiry(description=str(inquiry), add_state=False, USERNAME=user_for_save, report_id=report_obj_for_save, reported_date=now.date(), reported_time=(str(now.hour) + ":" + str(now.minute))) inq.save()
def abc(): r4 = Report(report_id='213052018', authority_id=Authority.objects.get(authority_id=2)) r4.save() i1 = Inquiry(reported_date='13/05/2018', reported_time='13:55', USERNAME=User.objects.get(username='******'), description="train does not come on time", report_id=r4, add_state=False) i1.save() i1 = Inquiry(reported_date='13/05/2018', reported_time='13:55', USERNAME=User.objects.get(username='******'), description="train does not come on time", report_id=r4, add_state=False) i1.save() r5 = Report(report_id='212052018', authority_id=Authority.objects.get(authority_id=2)) r5.save() i1 = Inquiry(reported_date='12/05/2018', reported_time='12:23', USERNAME=User.objects.get(username='******'), description="heavyly loaded train", report_id=r5, add_state=False) i1.save() r5 = Report(report_id='211052018', authority_id=Authority.objects.get(authority_id=2)) r5.save() i1 = Inquiry(reported_date='11/05/2018', reported_time='12:23', USERNAME=User.objects.get(username='******'), description="heavyly loaded train", report_id=r5, add_state=False) i1.save()
def adddatabus(): #for busses r0 = Report(report_id='115052018', authority_id=Authority.objects.get(authority_id=1)) r0.save() r1 = Report(report_id='112052018', authority_id=Authority.objects.get(authority_id=1)) r1.save() r2 = Report(report_id='112042018', authority_id=Authority.objects.get(authority_id=1)) r2.save() r3 = Report(report_id='112032018', authority_id=Authority.objects.get(authority_id=1)) r3.save() r4 = Report(report_id='112022018', authority_id=Authority.objects.get(authority_id=1)) r4.save() r5 = Report(report_id='112012018', authority_id=Authority.objects.get(authority_id=1)) r5.save() r6 = Report(report_id='112122017', authority_id=Authority.objects.get(authority_id=1)) r6.save() r7 = Report(report_id='112112017', authority_id=Authority.objects.get(authority_id=1)) r7.save() r8 = Report(report_id='112102017', authority_id=Authority.objects.get(authority_id=1)) r8.save() r9 = Report(report_id='112092017', authority_id=Authority.objects.get(authority_id=1)) r9.save() r10 = Report(report_id='112082017', authority_id=Authority.objects.get(authority_id=1)) r10.save() r11 = Report(report_id='112072017', authority_id=Authority.objects.get(authority_id=1)) r11.save() r12 = Report(report_id='112062017', authority_id=Authority.objects.get(authority_id=1)) r12.save() #new r13 = Report(report_id='114052018', authority_id=Authority.objects.get(authority_id=1)) r13.save() r14 = Report(report_id='113052018', authority_id=Authority.objects.get(authority_id=1)) r14.save() i1 = Inquiry(reported_date='12/04/2018', reported_time='13:00', USERNAME=User.objects.get(username='******'), description="conductor does not give change money", report_id=r2, add_state=False) i1.save() i2 = Inquiry(reported_date='12/03/2018', reported_time='12:34', USERNAME=User.objects.get(username='******'), description="conductor is misbahaving", report_id=r3, add_state=False) i2.save() i3 = Inquiry(reported_date='12/02/2018', reported_time='5:33', USERNAME=User.objects.get(username='******'), description="conductor brhavior is unacceptable", report_id=r4, add_state=False) i3.save() i4 = Inquiry(reported_date='12/01/2018', reported_time='14:23', USERNAME=User.objects.get(username='******'), description="The route is needed another bus", report_id=r5, add_state=False) i4.save() i5 = Inquiry(reported_date='12/12/2017', reported_time='14:12', USERNAME=User.objects.get(username='******'), description="very old bus not suitable for usage", report_id=r5, add_state=False) i5.save() i6 = Inquiry(reported_date='12/11/2017', reported_time='19:55', USERNAME=User.objects.get(username='******'), description="driver is drunken", report_id=r6, add_state=False) i6.save() i7 = Inquiry(reported_date='12/10/2017', reported_time='13:45', USERNAME=User.objects.get(username='******'), description="heavey crowd for the bus", report_id=r7, add_state=False) i7.save() i8 = Inquiry(reported_date='12/09/2017', reported_time='10:55', USERNAME=User.objects.get(username='******'), description="bus goes very slowly", report_id=r8, add_state=False) i8.save() i9 = Inquiry(reported_date='12/08/2018', reported_time='15:34', USERNAME=User.objects.get(username='******'), description="driver misbehaviors", report_id=r9, add_state=False) i9.save() i10 = Inquiry(reported_date='12/07/2018', reported_time='10:44', USERNAME=User.objects.get(username='******'), description="driver drives fast", report_id=r10, add_state=False) i10.save() i11 = Inquiry(reported_date='12/06/2018', reported_time='9:45', USERNAME=User.objects.get(username='******'), description="bus does not come at time", report_id=r11, add_state=False) i11.save() i12 = Inquiry(reported_date='12/05/2018', reported_time='17:45', USERNAME=User.objects.get(username='******'), description="pocket pickings are happening in the bus", report_id=r12, add_state=False) i12.save() i8.save() i9 = Inquiry(reported_date='12/08/2018', reported_time='3:55', USERNAME=User.objects.get(username='******'), description="busgoing fast", report_id=r9, add_state=False) i9.save() i10 = Inquiry(reported_date='12/07/2018', reported_time='3:55', USERNAME=User.objects.get(username='******'), description="busgoing fast", report_id=r10, add_state=False) i7 = Inquiry(reported_date='12/10/2017', reported_time='3:55', USERNAME=User.objects.get(username='******'), description="busgoing fast", report_id=r7, add_state=False) i7.save() i8 = Inquiry(reported_date='12/09/2017', reported_time='3:55', USERNAME=User.objects.get(username='******'), description="busgoing fast", report_id=r8, add_state=False) i8.save() i9 = Inquiry(reported_date='12/08/2018', reported_time='3:55', USERNAME=User.objects.get(username='******'), description="busgoing fast", report_id=r9, add_state=False) i12 = Inquiry(reported_date='12/05/2018', reported_time='17:45', USERNAME=User.objects.get(username='******'), description="pocket pickings are happening in the bus", report_id=r12, add_state=False) i12.save() i9 = Inquiry(reported_date='12/08/2018', reported_time='17:33', USERNAME=User.objects.get(username='******'), description="bus has unacceptable speed", report_id=r9, add_state=False) i9.save() i10 = Inquiry(reported_date='12/07/2018', reported_time='11:55', USERNAME=User.objects.get(username='******'), description="there are too mush crowd for the bus", report_id=r10, add_state=False) i7 = Inquiry(reported_date='12/10/2017', reported_time='3:55', USERNAME=User.objects.get(username='******'), description="busgoing fast", report_id=r7, add_state=False) i7.save() i8 = Inquiry(reported_date='12/09/2017', reported_time='20:13', USERNAME=User.objects.get(username='******'), description="annoying money collecters are in the bus", report_id=r8, add_state=False) i8.save() i9 = Inquiry(reported_date='12/08/2018', reported_time='3:55', USERNAME=User.objects.get(username='******'), description="busgoing fast", report_id=r9, add_state=False)
def addToBusDate(): r1 = Report(report_id='112052018', authority_id=Authority.objects.get(authority_id=1)) r1.save() i1 = Inquiry(reported_date='12/05/2018', reported_time='3:10', USERNAME=User.objects.get(username='******'), description="bus go fast", report_id=r1, add_state=False) i1.save() i1 = Inquiry(reported_date='12/05/2018', reported_time='4:55', USERNAME=User.objects.get(username='******'), description="routes are broken", report_id=r1, add_state=False) i1.save() # r2 = Report(report_id='111052018', authority_id=Authority.objects.get(authority_id=1)) r2.save() i1 = Inquiry(reported_date='11/05/2018', reported_time='10:55', USERNAME=User.objects.get(username='******'), description="heavy crowd in the bus", report_id=r2, add_state=False) i1.save() i1 = Inquiry(reported_date='11/05/2018', reported_time='7:45', USERNAME=User.objects.get(username='******'), description="old bus", report_id=r2, add_state=False) i1.save() i1 = Inquiry(reported_date='11/05/2018', reported_time='8:45', USERNAME=User.objects.get(username='******'), description="uncomfirtable bus", report_id=r2, add_state=False) i1.save() # r3 = Report(report_id='114052018', authority_id=Authority.objects.get(authority_id=1)) r3.save() i1 = Inquiry(reported_date='14/05/2018', reported_time='13:25', USERNAME=User.objects.get(username='******'), description="broken bus", report_id=r3, add_state=False) i1.save() i1 = Inquiry(reported_date='14/05/2018', reported_time='18:56', USERNAME=User.objects.get(username='******'), description="routes are not in good condition", report_id=r3, add_state=False) i1.save() i1 = Inquiry(reported_date='14/05/2018', reported_time='3:55', USERNAME=User.objects.get(username='******'), description="over loaded bus", report_id=r3, add_state=False) i1.save() # r4 = Report(report_id='115052018', authority_id=Authority.objects.get(authority_id=1)) r4.save() i1 = Inquiry(reported_date='15/05/2018', reported_time='13:55', USERNAME=User.objects.get(username='******'), description="huge crowd in bus", report_id=r4, add_state=False) r5 = Report(report_id='114052018', authority_id=Authority.objects.get(authority_id=1)) r5.save() i1.save() i1 = Inquiry(reported_date='15/05/2018', reported_time='12:23', USERNAME=User.objects.get(username='******'), description="heavyly loaded bus", report_id=r4, add_state=False) i1.save() # r1 = Report(report_id='111052018', authority_id=Authority.objects.get(authority_id=1)) r1.save() i1 = Inquiry(reported_date='11/05/2018', reported_time='3:10', USERNAME=User.objects.get(username='******'), description="bus go fast", report_id=r1, add_state=False) i1.save() i1 = Inquiry(reported_date='11/05/2018', reported_time='4:55', USERNAME=User.objects.get(username='******'), description="routes are broken", report_id=r1, add_state=False) i1.save() # r2 = Report(report_id='110052018', authority_id=Authority.objects.get(authority_id=1)) r2.save() i1 = Inquiry(reported_date='10/05/2018', reported_time='10:55', USERNAME=User.objects.get(username='******'), description="heavy crowd in the bus", report_id=r2, add_state=False) i1.save() i1 = Inquiry(reported_date='10/05/2018', reported_time='7:45', USERNAME=User.objects.get(username='******'), description="old bus", report_id=r2, add_state=False) i1.save() i1 = Inquiry(reported_date='10/05/2018', reported_time='8:45', USERNAME=User.objects.get(username='******'), description="uncomfirtable bus", report_id=r2, add_state=False) i1.save() # r3 = Report(report_id='114052018', authority_id=Authority.objects.get(authority_id=1)) r3.save() i1 = Inquiry(reported_date='14/05/2018', reported_time='13:25', USERNAME=User.objects.get(username='******'), description="broken bus", report_id=r3, add_state=False) i1.save() i1 = Inquiry(reported_date='14/05/2018', reported_time='18:56', USERNAME=User.objects.get(username='******'), description="routes are not in good condition", report_id=r3, add_state=False) i1.save() i1 = Inquiry(reported_date='14/05/2018', reported_time='3:55', USERNAME=User.objects.get(username='******'), description="over loaded bus", report_id=r3, add_state=False) i1.save() # r4 = Report(report_id='115052018', authority_id=Authority.objects.get(authority_id=1)) r4.save() i1 = Inquiry(reported_date='15/05/2018', reported_time='13:55', USERNAME=User.objects.get(username='******'), description="huge crowd in bus", report_id=r4, add_state=False) r5 = Report(report_id='114052018', authority_id=Authority.objects.get(authority_id=1)) r5.save() i1.save() i1 = Inquiry(reported_date='15/05/2018', reported_time='12:23', USERNAME=User.objects.get(username='******'), description="heavyly loaded bus", report_id=r4, add_state=False) i1.save()
def addInqdatefortrain(): r1 = Report(report_id='212052018', authority_id=Authority.objects.get(authority_id=2)) r1.save() i1 = Inquiry(reported_date='12/05/2018', reported_time='3:10', USERNAME=User.objects.get(username='******'), description="train go fast", report_id=r1, add_state=False) i1.save() i1 = Inquiry(reported_date='12/05/2018', reported_time='4:55', USERNAME=User.objects.get(username='******'), description="signal lights are not working properly", report_id=r1, add_state=False) i1.save() # r2 = Report(report_id='211052018', authority_id=Authority.objects.get(authority_id=2)) r2.save() i1 = Inquiry(reported_date='11/05/2018', reported_time='10:55', USERNAME=User.objects.get(username='******'), description="heavy crowd in the train", report_id=r2, add_state=False) i1.save() i1 = Inquiry(reported_date='11/05/2018', reported_time='7:45', USERNAME=User.objects.get(username='******'), description="old train", report_id=r2, add_state=False) i1.save() i1 = Inquiry(reported_date='11/05/2018', reported_time='8:45', USERNAME=User.objects.get(username='******'), description="uncomfirtable train", report_id=r2, add_state=False) i1.save() # r3 = Report(report_id='214052018', authority_id=Authority.objects.get(authority_id=2)) r3.save() i1 = Inquiry(reported_date='14/05/2018', reported_time='13:25', USERNAME=User.objects.get(username='******'), description="broken train", report_id=r3, add_state=False) i1.save() i1 = Inquiry(reported_date='14/05/2018', reported_time='18:56', USERNAME=User.objects.get(username='******'), description="routes are not in good condition", report_id=r3, add_state=False) i1.save() i1 = Inquiry(reported_date='14/05/2018', reported_time='3:55', USERNAME=User.objects.get(username='******'), description="over loaded train", report_id=r3, add_state=False) i1.save() # r4 = Report(report_id='215052018', authority_id=Authority.objects.get(authority_id=2)) r4.save() i1 = Inquiry(reported_date='15/05/2018', reported_time='13:55', USERNAME=User.objects.get(username='******'), description="huge crowd in train", report_id=r4, add_state=False) r5 = Report(report_id='208052018', authority_id=Authority.objects.get(authority_id=2)) r5.save() i1.save() i1 = Inquiry(reported_date='15/05/2018', reported_time='12:23', USERNAME=User.objects.get(username='******'), description="heavyly loaded train", report_id=r4, add_state=False) i1.save()
def addtotrain(): r1 = Report(report_id='212052018', authority_id=Authority.objects.get(authority_id=2)) r1.save() r2 = Report(report_id='212042018', authority_id=Authority.objects.get(authority_id=2)) r2.save() r3 = Report(report_id='212032018', authority_id=Authority.objects.get(authority_id=2)) r3.save() r4 = Report(report_id='212022018', authority_id=Authority.objects.get(authority_id=2)) r4.save() r5 = Report(report_id='212012018', authority_id=Authority.objects.get(authority_id=2)) r5.save() r6 = Report(report_id='212122017', authority_id=Authority.objects.get(authority_id=2)) r6.save() r7 = Report(report_id='212112017', authority_id=Authority.objects.get(authority_id=2)) r7.save() r8 = Report(report_id='212102017', authority_id=Authority.objects.get(authority_id=2)) r8.save() r9 = Report(report_id='212092017', authority_id=Authority.objects.get(authority_id=2)) r9.save() r10 = Report(report_id='212082017', authority_id=Authority.objects.get(authority_id=2)) r10.save() r11 = Report(report_id='212072017', authority_id=Authority.objects.get(authority_id=2)) r11.save() r12 = Report(report_id='212062017', authority_id=Authority.objects.get(authority_id=2)) r12.save() i1 = Inquiry(reported_date='12/04/2018', reported_time='3:45', USERNAME=User.objects.get(username='******'), description="train is too slow", report_id=r2, add_state=False) i1.save() i2 = Inquiry(reported_date='12/03/2018', reported_time='12:56', USERNAME=User.objects.get(username='******'), description="over crowded train", report_id=r3, add_state=False) i2.save() i3 = Inquiry(reported_date='12/02/2018', reported_time='6:00', USERNAME=User.objects.get(username='******'), description="train is always late", report_id=r4, add_state=False) i3.save() i4 = Inquiry(reported_date='12/01/2018', reported_time='9:50', USERNAME=User.objects.get(username='******'), description="train geting late", report_id=r5, add_state=False) i4.save() i5 = Inquiry(reported_date='12/12/2017', reported_time='10:55', USERNAME=User.objects.get(username='******'), description="rail roads are not in good condition", report_id=r5, add_state=False) i5.save() i6 = Inquiry(reported_date='12/11/2017', reported_time='3:55', USERNAME=User.objects.get(username='******'), description="signal lights are not working properly", report_id=r6, add_state=False) i6.save() i7 = Inquiry(reported_date='12/10/2017', reported_time='3:55', USERNAME=User.objects.get(username='******'), description="train is late", report_id=r7, add_state=False) i7.save() i8 = Inquiry( reported_date='12/09/2017', reported_time='9:56', USERNAME=User.objects.get(username='******'), description="very old train and not good for passenger health", report_id=r8, add_state=False) i8.save() i9 = Inquiry(reported_date='12/08/2018', reported_time='10:55', USERNAME=User.objects.get(username='******'), description="train is getting late", report_id=r9, add_state=False) i9.save() i10 = Inquiry(reported_date='12/07/2018', reported_time='12:35', USERNAME=User.objects.get(username='******'), description="train does not come on time", report_id=r10, add_state=False) i10.save() i11 = Inquiry(reported_date='12/06/2018', reported_time='10:15', USERNAME=User.objects.get(username='******'), description="pocket pickings are happening in the train", report_id=r11, add_state=False) i11.save() i12 = Inquiry(reported_date='12/05/2018', reported_time='3:55', USERNAME=User.objects.get(username='******'), description="train is late", report_id=r12, add_state=False) i12.save() i8.save() i9 = Inquiry(reported_date='12/08/2018', reported_time='11:22', USERNAME=User.objects.get(username='******'), description="heavey crowd for train at the office times", report_id=r9, add_state=False) i9.save() i10 = Inquiry(reported_date='12/07/2018', reported_time='3:55', USERNAME=User.objects.get(username='******'), description="rail gates are not working properly", report_id=r10, add_state=False) i10.save() i7 = Inquiry(reported_date='12/10/2017', reported_time='13:55', USERNAME=User.objects.get(username='******'), description="annoying money collecters are within the train", report_id=r7, add_state=False) i7.save() i8 = Inquiry(reported_date='12/09/2017', reported_time='12:30', USERNAME=User.objects.get(username='******'), description="no enough space in the train", report_id=r8, add_state=False) i8.save() i9 = Inquiry(reported_date='12/08/2018', reported_time='16:45', USERNAME=User.objects.get(username='******'), description="heavyly loaded train", report_id=r9, add_state=False) i9.save() i5.save() i2.save()
def adddatabus(): #for busses r1 = Report(report_id='112052018',authority_id=Authority.objects.get(authority_id=1)) r1.save() r2 = Report(report_id='112042018',authority_id=Authority.objects.get(authority_id=1)) r2.save() r3=Report(report_id='112032018', authority_id=Authority.objects.get(authority_id=1)) r3.save() r4 = Report(report_id='112022018',authority_id=Authority.objects.get(authority_id=1)) r4.save() r5=Report(report_id='112012018',authority_id=Authority.objects.get(authority_id=1)) r5.save() r6 = Report(report_id='112122017', authority_id=Authority.objects.get(authority_id=1)) r6.save() r7 = Report(report_id='112112017', authority_id=Authority.objects.get(authority_id=1)) r7.save() r8 = Report(report_id='112102017', authority_id=Authority.objects.get(authority_id=1)) r8.save() r9 = Report(report_id='112092017', authority_id=Authority.objects.get(authority_id=1)) r9.save() r10 = Report(report_id='112082017', authority_id=Authority.objects.get(authority_id=1)) r10.save() r11 = Report(report_id='112072017', authority_id=Authority.objects.get(authority_id=1)) r11.save() r12 = Report(report_id='112062017', authority_id=Authority.objects.get(authority_id=1)) r12.save() i1 = Inquiry(reported_date='12/04/2018',reported_time='3:55',USERNAME=User.objects.get(username='******'), description="busgoing fast",report_id=r2,add_state=False) i1.save() i2 = Inquiry(reported_date='12/03/2018', reported_time='3:55', USERNAME=User.objects.get(username='******'), description="busgoing fast", report_id=r3,add_state=False) i2.save() i3 = Inquiry(reported_date='12/02/2018', reported_time='3:55', USERNAME=User.objects.get(username='******'), description="busgoing fast", report_id=r4,add_state=False) i3.save() i4 = Inquiry(reported_date='12/01/2018',reported_time='3:55',USERNAME=User.objects.get(username='******'), description="busgoing fast",report_id=r5,add_state=False) i4.save() i5 = Inquiry(reported_date='12/12/2017', reported_time='3:55', USERNAME=User.objects.get(username='******'), description="busgoing fast", report_id=r5, add_state=False) i5.save() i6 = Inquiry(reported_date='12/11/2017', reported_time='3:55', USERNAME=User.objects.get(username='******'), description="busgoing fast", report_id=r6, add_state=False) i6.save() i7 = Inquiry(reported_date='12/10/2017', reported_time='3:55', USERNAME=User.objects.get(username='******'), description="busgoing fast", report_id=r7, add_state=False) i7.save() i8 = Inquiry(reported_date='12/09/2017', reported_time='3:55', USERNAME=User.objects.get(username='******'), description="busgoing fast", report_id=r8, add_state=False) i8.save() i9 = Inquiry(reported_date='12/08/2018', reported_time='3:55', USERNAME=User.objects.get(username='******'), description="busgoing fast", report_id=r9, add_state=False) i9.save() i10 = Inquiry(reported_date='12/07/2018', reported_time='3:55', USERNAME=User.objects.get(username='******'), description="busgoing fast", report_id=r10, add_state=False) i10.save() i11 = Inquiry(reported_date='12/06/2018', reported_time='3:55', USERNAME=User.objects.get(username='******'), description="busgoing fast", report_id=r11, add_state=False) i11.save() i12 = Inquiry(reported_date='12/05/2018', reported_time='3:55', USERNAME=User.objects.get(username='******'), description="busgoing fast", report_id=r12, add_state=False) i12.save() i8.save() i9 = Inquiry(reported_date='12/08/2018', reported_time='3:55', USERNAME=User.objects.get(username='******'), description="busgoing fast", report_id=r9, add_state=False) i9.save() i10 = Inquiry(reported_date='12/07/2018', reported_time='3:55', USERNAME=User.objects.get(username='******'), description="busgoing fast", report_id=r10, add_state=False) i7 = Inquiry(reported_date='12/10/2017', reported_time='3:55', USERNAME=User.objects.get(username='******'), description="busgoing fast", report_id=r7, add_state=False) i7.save() i8 = Inquiry(reported_date='12/09/2017', reported_time='3:55', USERNAME=User.objects.get(username='******'), description="busgoing fast", report_id=r8, add_state=False) i8.save() i9 = Inquiry(reported_date='12/08/2018', reported_time='3:55', USERNAME=User.objects.get(username='******'), description="busgoing fast", report_id=r9, add_state=False)
def addInqnearDates(): r1 = Report(report_id='112052018', authority_id=Authority.objects.get(authority_id=1)) r1.save() i1 = Inquiry(reported_date='12/05/2018', reported_time='3:55', USERNAME=User.objects.get(username='******'), description="bus go fast", report_id=r1, add_state=False) i1.save() i1 = Inquiry(reported_date='12/05/2018', reported_time='3:55', USERNAME=User.objects.get(username='******'), description="conductor not good", report_id=r1, add_state=False) i1.save() # r2 = Report(report_id='111052018', authority_id=Authority.objects.get(authority_id=1)) r2.save() i1 = Inquiry(reported_date='11/05/2018', reported_time='3:55', USERNAME=User.objects.get(username='******'), description="bus going fast", report_id=r2, add_state=False) i1.save() i1 = Inquiry(reported_date='11/05/2018', reported_time='3:55', USERNAME=User.objects.get(username='******'), description="conductor behavior is not good", report_id=r2, add_state=False) i1.save() # r3 = Report(report_id='110052018', authority_id=Authority.objects.get(authority_id=1)) r3.save() i1 = Inquiry(reported_date='10/05/2018', reported_time='3:55', USERNAME=User.objects.get(username='******'), description="brokeb bus", report_id=r3, add_state=False) i1.save() i1 = Inquiry(reported_date='10/05/2018', reported_time='3:55', USERNAME=User.objects.get(username='******'), description="conductor misbehaviors", report_id=r3, add_state=False) i1.save() # r4 = Report(report_id='109052018', authority_id=Authority.objects.get(authority_id=1)) r4.save() i1 = Inquiry(reported_date='09/05/2018', reported_time='3:55', USERNAME=User.objects.get(username='******'), description="brokeb bus", report_id=r4, add_state=False) r5 = Report(report_id='108052018', authority_id=Authority.objects.get(authority_id=1)) r5.save() i1.save() i1 = Inquiry(reported_date='08/05/2018', reported_time='3:55', USERNAME=User.objects.get(username='******'), description="conductor misbehaviors", report_id=r5, add_state=False) i1.save()
def addTrainForDate(): r1 = Report(report_id='112052018', authority_id=Authority.objects.get(authority_id=1)) r1.save() r2 = Report(report_id='111052018', authority_id=Authority.objects.get(authority_id=1)) r2.save() r3 = Report(report_id='110052018', authority_id=Authority.objects.get(authority_id=1)) r3.save() r4 = Report(report_id='109052018', authority_id=Authority.objects.get(authority_id=1)) r4.save() r5 = Report(report_id='108052018', authority_id=Authority.objects.get(authority_id=1)) r5.save() r6 = Report(report_id='107052018', authority_id=Authority.objects.get(authority_id=1)) r6.save() r4 = Report(report_id='106052018', authority_id=Authority.objects.get(authority_id=1)) r4.save() r5 = Report(report_id='104052018', authority_id=Authority.objects.get(authority_id=1)) r5.save() r6 = Report(report_id='103052018', authority_id=Authority.objects.get(authority_id=1)) r6.save() i1 = Inquiry(reported_date='12/05/2018', reported_time='3:55', USERNAME=User.objects.get(username='******'), description="busgoing fast", report_id=r1, add_state=False) i1.save() i2 = Inquiry(reported_date='11/05/2018', reported_time='3:55', USERNAME=User.objects.get(username='******'), description="train is late", report_id=r2, add_state=False) i2.save() i3 = Inquiry(reported_date='10/05/2018', reported_time='3:55', USERNAME=User.objects.get(username='******'), description="train is late", report_id=r3, add_state=False) i3.save() i4 = Inquiry(reported_date='09/05/2018', reported_time='3:55', USERNAME=User.objects.get(username='******'), description="train is late", report_id=r4, add_state=False) i4.save() i5 = Inquiry(reported_date='08/05/2017', reported_time='3:55', USERNAME=User.objects.get(username='******'), description="train is late", report_id=r5, add_state=False) i5.save() i6 = Inquiry(reported_date='07/05/2017', reported_time='3:55', USERNAME=User.objects.get(username='******'), description="train is late", report_id=r6, add_state=False) i4.save() i6.save() i3.save() i5.save() i1.save() i6.save()