예제 #1
0
    def createCompany():
        data = request.get_json()
        table = "company"
        columns = "name"
        values = str(data['name'])

        obj = DB()
        id_row = obj.queryInsert(table, columns, values)
        return id_row
예제 #2
0
 def createTitle():
     table = "title"
     columns = "name"
     values = request.form['textbox-title']
     print values
     obj = DB()
     id_row = obj.queryInsert(table, columns, values)
     print id_row
     obj = Title()
     return obj.getTitle()
예제 #3
0
 def getTitle(self):
     table = "title"
     columns = "name"
     obj = DB()
     id_row, list_rows = obj.querySelect(table, columns)
     list_titles = []
     for title in list_rows:
         list_titles.append(title[0])
     print list_titles
     values = list_titles
     return render_template('titles.html', list_titles=values)
예제 #4
0
    def getApplication(self):
        table = "application"
        columns = "title, company, location, next_action"
        obj = DB()
        id_row, list_rows = obj.querySelect(table, columns)
        list_applications = []

        for row in list_rows:
            application = {}
            application['title'] = row[0]
            application['company'] = row[1]
            application['location'] = row[2]
            application['next_action'] = row[3]
            list_applications.append(application)
        print list_applications
        values = list_applications
        return render_template('applications.html', list_applications=values)
예제 #5
0
    def createApplication():
        print "insdie application create"
        table = "application"
        columns = ""
        values = ""

        dict_form_data = request.form
        for key in dict_form_data:
            columns = columns + "," + key
            values = values + "," + "'" + dict_form_data[key] + "'"
        columns = columns[1:]
        values = values[1:].strip()
        print values

        obj = DB()
        id_row = obj.queryInsert(table, columns, values)
        print id_row
        obj = Application()
        return obj.getApplication()