Skip to content

Commit 51c4ae3

Browse files
committed
Updates structure
1 parent 03e2111 commit 51c4ae3

File tree

9 files changed

+133
-471
lines changed

9 files changed

+133
-471
lines changed

.idea/PythonDemo.iml

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/dataSources.xml

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/sqldialects.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/workspace.xml

Lines changed: 94 additions & 447 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

com/demo/dao/CustomerDao.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ class CustomerDao:
55
def __init__(self):
66
self.mydb = mysql.connector.connect(
77
host="127.0.0.1",
8-
user="cuckoo",
9-
password="cuckoo",
8+
user="root",
9+
password="bcmc1234",
1010
database="employees"
1111
);
1212
self.mycursor = self.mydb.cursor();

com/demo/tests/MySqlTest.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import mysql.connector
22

33
mydb = mysql.connector.connect(
4-
host="127.0.0.1",
5-
user="cuckoo",
6-
passwd="cuckoo",
7-
database="employees",
8-
auth_plugin="mysql_native_password" #This line is optional, include if you SHA2 auth error
9-
);
4+
host="127.0.0.1",
5+
user="root",
6+
passwd="bcmc1234",
7+
database="employees",
8+
auth_plugin="mysql_native_password" # This line is optional, include if you SHA2 auth error
9+
);
1010

1111
mycursor = mydb.cursor()
1212

@@ -33,7 +33,7 @@
3333
]
3434
mycursor.executemany(sql, values);
3535
mydb.commit();
36-
print "Hello"
36+
print("Hello")
3737

3838

3939
except mysql.connector.Error as err:
@@ -42,4 +42,4 @@
4242
mycursor.execute("Select * from customers");
4343
customers = mycursor.fetchall();
4444
for customer in customers:
45-
print(customer);
45+
print(customer);

com/demo/tests/tensorflow.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
import tensorflow as tf
2-
from tensorflow import keras
3-
4-
print
1+
print('Hello')

com/demo/web/CustomersController.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,10 @@
22
from flask import jsonify
33
from flask import render_template
44
from flask import request
5-
from wtforms import Form, TextField, TextAreaField, validators, StringField, SubmitField
6-
from flask_restful import Resource, Api
7-
from flask_assets import Environment, Bundle
8-
5+
from wtforms import Form, validators, StringField
96

107
from com.demo.dao.CustomerDao import CustomerDao
11-
12-
#template folder location should be relevant to current file i.e. CustomersController.py
8+
# template folder location should be relevant to current file i.e. CustomersController.py
139
from com.demo.models.Customer import Customer
1410

1511
app = Flask(__name__, template_folder='../../../templates');
@@ -34,8 +30,8 @@ def getCustomers():
3430

3531
@app.route("/customers")
3632
def getCustomerPage():
37-
customerDao = CustomerDao();
38-
return jsonify(customerDao.getCustomers());
33+
form = ReusableForm(request.form)
34+
return render_template("customers.html", form=form);
3935

4036
@app.route("/savecustomer",methods=['POST'])
4137
def saveCustomer():

0 commit comments

Comments
 (0)