Pickahu can be seen napping in a bright sunlight. It has two
+ red dots
+ on its cheeks. By practicing html and css Pickahu can learn confusion.
+ Pickahu likes to steal computer chargers from sleeping college students.
+
Pickahu can be seen napping in a bright sunlight. It has two
+ red dots on its cheeks. By practicing html and css Pickahu can learn confusion.
+ Pickahu likes to steal computer chargers from sleeping college students.
+
+{% endblock %}
diff --git a/Labs/Lab - orm_tutorial/app/views.py b/Labs/Lab - orm_tutorial/app/views.py
new file mode 100755
index 0000000..dab8eed
--- /dev/null
+++ b/Labs/Lab - orm_tutorial/app/views.py
@@ -0,0 +1,21 @@
+from flask import render_template, redirect, request
+from app import app, models, db
+from .forms import CustomerForm
+
+
+@app.route('/')
+def index():
+ return redirect('/create_customer')
+
+@app.route('/create_customer', methods=['GET', 'POST'])
+def create_customer():
+ form = CustomerForm()
+ #Capture form data and send to database
+ return redirect('/customers')
+ return render_template('customer.html', form=form)
+
+@app.route('/customers')
+def display_customer():
+ #Fetch customer data from database
+ return render_template('home.html',
+ customers=customers)
diff --git a/Labs/Lab - orm_tutorial/app/views.pyc b/Labs/Lab - orm_tutorial/app/views.pyc
new file mode 100644
index 0000000..e27a6bd
Binary files /dev/null and b/Labs/Lab - orm_tutorial/app/views.pyc differ
diff --git a/Labs/Lab - orm_tutorial/config.py b/Labs/Lab - orm_tutorial/config.py
new file mode 100755
index 0000000..a995426
--- /dev/null
+++ b/Labs/Lab - orm_tutorial/config.py
@@ -0,0 +1,8 @@
+import os
+basedir = os.path.abspath(os.path.dirname(__file__))
+
+SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'app.db')
+SQLALCHEMY_MIGRATE_REPO = os.path.join(basedir, 'db_repository')
+
+WTF_CSRF_ENABLED = True
+SECRET_KEY = 'you-will-never-guess'
diff --git a/Labs/Lab - orm_tutorial/config.pyc b/Labs/Lab - orm_tutorial/config.pyc
new file mode 100644
index 0000000..59af7fd
Binary files /dev/null and b/Labs/Lab - orm_tutorial/config.pyc differ
diff --git a/Labs/Lab - orm_tutorial/readme.md b/Labs/Lab - orm_tutorial/readme.md
new file mode 100755
index 0000000..f5a8d70
--- /dev/null
+++ b/Labs/Lab - orm_tutorial/readme.md
@@ -0,0 +1,21 @@
+# Models Lab/Homework
+The goal for this lab is to get you comfortable translating your database models into actual code. We will be using [ORMs](https://en.wikipedia.org/wiki/Object-relational_mapping) to help us. The particular ORM that we will be using is SQLAlchemy (the flask implementation is called [Flask-SQLAlchemy](http://flask-sqlalchemy.pocoo.org/2.1/)).
+
+We'll walk through the example together in class which will give you an idea of how this all works together. Your goal for this lab and homework is to create the remaining models, forms, and routes to complete v2 of the exercise from last week.
+
+This means that you must:
+* Create the following tables and the appropriate relationships:
+ * customer
+ * address
+ * order
+ * Remember to run update_database.py whenever you make changes to any models.
+ * This will update the database with your changes. However, **it will delete any data in the database**.
+* Create the forms, templates, routes, etc necessary to input this data into the database.
+* Create a view to showcase the data into your database (see the current implementation of "home.html" for example)
+
+The following documentation will help answer any questions you may have.
+
+## Helpful Documentation
+- [Flask-SQLAlchemy](http://flask-sqlalchemy.pocoo.org/2.1/)
+- [Accessing SQLite3 Command Shell](https://www.sqlite.org/cli.html)
+- [Flask-WTF](https://flask-wtf.readthedocs.org/en/latest/) (flask plugin for creating forms easily)
diff --git a/Labs/Lab - orm_tutorial/requirements.txt b/Labs/Lab - orm_tutorial/requirements.txt
new file mode 100755
index 0000000..bfbaf81
--- /dev/null
+++ b/Labs/Lab - orm_tutorial/requirements.txt
@@ -0,0 +1,10 @@
+Flask==0.10.1
+Flask-SQLAlchemy==2.1
+Flask-WTF==0.12
+itsdangerous==0.24
+Jinja2==2.8
+MarkupSafe==0.23
+SQLAlchemy==1.0.12
+Werkzeug==0.11.4
+wheel==0.29.0
+WTForms==2.1
diff --git a/Labs/Lab - orm_tutorial/run.py b/Labs/Lab - orm_tutorial/run.py
new file mode 100755
index 0000000..5d2f714
--- /dev/null
+++ b/Labs/Lab - orm_tutorial/run.py
@@ -0,0 +1,2 @@
+from app import app
+app.run(debug=True, host="0.0.0.0", port=8081)
diff --git a/Labs/Lab - orm_tutorial/update_database.py b/Labs/Lab - orm_tutorial/update_database.py
new file mode 100755
index 0000000..b15e4da
--- /dev/null
+++ b/Labs/Lab - orm_tutorial/update_database.py
@@ -0,0 +1,3 @@
+from app import db
+db.drop_all()
+db.create_all()