예제 #1
0
    def test_schedule_delete(self):
        dbservices = ScheduleDBServices()
        dbservices.openConnection()
        dbservices.createEmpSchedules()
        dbservices.insert(sch, "testuser")
        dbservices.delete("testuser", sch)

        newSch = dbservices.get("testuser")
        self.assertIsNull(newSch.getId())
예제 #2
0
def insertScheduleAction(request):

    schedule = Schedule()

    schedule.setUsername(request.GET['username'])
    schedule.setDay(request.GET['day'])
    schedule.setMonth(request.GET['month'])
    schedule.setTime(request.GET['time'])
    schedule.setDate(request.GET['date'])
    schedule.setId(request.GET['id'])

    db = ScheduleDBServices()
    db.open()
    db.insert(schedule, schedule.getUsername())
    db.close()

    return render(request, 'ScheduleManager.html')