Пример #1
0
    def create(self, keyword, user_input):
        '''Creates new object and saves to Database. \n
        keyword: employee,airplane,destination or worktrip
        \n
        user_input: user input for corresponding item as tuple. No id or registration date.
        '''
        if keyword == 'employee':
            cr_emp = EmployeeLL()
            run_create = cr_emp.create_employee(user_input)

        elif keyword == 'airplane':
            cr_air = AirplanesLL()
            run_create = cr_air.create_airplane(user_input)

        elif keyword == 'destination':
            cr_dest = DestinationLL()
            run_create = cr_dest.create_destination(user_input)

        elif keyword == 'worktrip':
            cr_trip = WorktripLL()
            run_create = cr_trip.create_worktrip(user_input)

        return run_create
    def create(self, keyword,user_input):    
        '''
        \n Creates new object and saves to Database. Returns msg with success or error. \n
        keyword [string]: employee /airplane / destination / worktrip\n
        user_input [tuple]: User input for corresponding item as tuple with a leading empty string.
        '''

        if keyword == 'employee':
            cr_emp = EmployeeLL() 
            run_create = cr_emp.create_employee(user_input) 

        elif keyword == 'airplane':
            cr_air = AirplanesLL()
            run_create = cr_air.create_airplane(user_input)

        elif keyword == 'destination':
            cr_dest = DestinationLL()
            run_create = cr_dest.create_destination(user_input)

        elif keyword =='worktrip':
            cr_trip = WorktripLL()
            run_create = cr_trip.create_worktrip(user_input)  

        return run_create