-
Notifications
You must be signed in to change notification settings - Fork 0
/
create_db.py
54 lines (42 loc) · 13.2 KB
/
create_db.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
from app import db
from app.models import Student, Teacher, Graph, Task, Mark
def setup_database():
db.create_all()
u1=Student('Heather','Freeman','[email protected]','Abc123','student')
u2=Student('Amanda','Evans','[email protected]','Cde456','student')
u3=Student('Jerry','White','[email protected]','qwerty123','student')
u4=Student('Jane', 'Berry', '[email protected]','tyu1234','student')
u5=Student('Lori','Welch','[email protected]','erg34345','student')
u6=Student('Dorothy','Medina','[email protected]','bfdg2','student')
u7=Student('Lawrence','Foster','[email protected]','regergs2','student')
u8=Student('Annie','Pierce','[email protected]','bfg3','student')
u9=Student('Melissa','Taylor','[email protected]','eret3','student')
u10=Student('Deborah','Richards','[email protected]','opi234','student')
t1 = Teacher('Albert','Morris','[email protected]','abc123','teacher')
t2 = Teacher('Jane','Ripper','[email protected]','abc123','teacher')
task1 = Task(1, 1, 1)
task2 = Task(2, 1, 1)
task3 = Task(1, 2, 1)
task3.mark_id = 1
task3.completed = True
m1 = Mark(7, 10, 1, 2)
m2 = Mark(1, 10, 3, 3)
m3 = Mark(1, 10, 5, 3)
m4 = Mark(4, 10, 5, 3)
m5 = Mark(5, 10, 4, 3)
m6 = Mark(3, 10, 2, 4)
db.session.add_all([u1, u2, u3, u4, u5, u6, u7, u8, u9, u10, t1, t2])
db.session.add_all([task1, task2, task3])
db.session.add_all([m1, m2, m3, m4, m5, m6])
links = [t1.add_student(u1),
t1.add_student(u2),
t1.add_student(u3),
t1.add_student(u8),
t1.add_student(u9)]
db.session.add_all(links)
db.session.commit()
graph1 = Graph('{"version":2,"graph":{"showGrid":true,"showXAxis":true,"showYAxis":true,"xAxisStep":0,"yAxisStep":0,"xAxisMinorSubdivisions":0,"yAxisMinorSubdivisions":0,"xAxisArrowMode":"NONE","yAxisArrowMode":"NONE","xAxisLabel":"Re","yAxisLabel":"Im","xAxisNumbers":true,"yAxisNumbers":true,"polarMode":false,"polarNumbers":true,"degreeMode":false,"projectorMode":false,"squareAxes":true,"viewport":{"xmin":-1.6708536134523648,"ymin":-1.9601353023240395,"xmax":1.9920012573229602,"ymax":1.847026847468353}},"expressions":{"list":[{"id":"0","type":"expression","latex":"\\sqrt{x^2+y^2}-\\sqrt{x^2+\\left(y+1\\right)^2}=0","domain":{"min":0,"max":1},"hidden":false,"color":"#2d70b3","style":"normal","residualVariable":"","regressionParameters":{},"isLogModeRegression":false},{"id":"1","type":"expression","latex":"\\sqrt{x^2+y^2}-\\sqrt{y^2+\\left(x-1\\right)^2}=0","domain":{"min":0,"max":1},"hidden":false,"color":"#388c46","style":"normal","residualVariable":"","regressionParameters":{},"isLogModeRegression":false}]}}','<thead><tr><th>Plot</th><th></th><th></th></tr></thead><tbody> <tr id="row0"><td><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-2-Frame" tabindex="0" style="position: relative;" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle displaystyle="true"><mrow><mo>|</mo><mi>z</mi><mo>|</mo></mrow><mo>=</mo><mrow><mo>|</mo><mi>z</mi><mo>+</mo><mi>i</mi><mo>|</mo></mrow></mstyle></math>" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-128" style="width: 6.074em; display: inline-block;"><span style="display: inline-block; position: relative; width: 5.06em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.691em, 1004.93em, 2.927em, -1000em); top: -2.56em; left: 0em;"><span class="mrow" id="MathJax-Span-129"><span class="mstyle" id="MathJax-Span-130"><span class="mrow" id="MathJax-Span-131"><span class="mrow" id="MathJax-Span-132"><span class="mo" id="MathJax-Span-133" style="font-family: STIXVariants;">|</span><span class="mi" id="MathJax-Span-134" style="font-family: STIXGeneral; font-style: italic;">z</span><span class="mo" id="MathJax-Span-135" style="font-family: STIXVariants;">|</span></span><span class="mo" id="MathJax-Span-136" style="font-family: STIXGeneral; padding-left: 0.375em; padding-right: 0.375em;">=</span><span class="mrow" id="MathJax-Span-137"><span class="mo" id="MathJax-Span-138" style="font-family: STIXVariants;">|</span><span class="mi" id="MathJax-Span-139" style="font-family: STIXGeneral; font-style: italic;">z</span><span class="mo" id="MathJax-Span-140" style="font-family: STIXGeneral; padding-left: 0.3em; padding-right: 0.3em;">+</span><span class="mi" id="MathJax-Span-141" style="font-family: STIXGeneral; font-style: italic;">i</span><span class="mo" id="MathJax-Span-142" style="font-family: STIXVariants;">|</span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.56em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.298em; border-left: 0px solid; width: 0px; height: 1.198em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle displaystyle="true"><mrow><mo>|</mo><mi>z</mi><mo>|</mo></mrow><mo>=</mo><mrow><mo>|</mo><mi>z</mi><mo>+</mo><mi>i</mi><mo>|</mo></mrow></mstyle></math></span></span><script type="math/asciimath" id="MathJax-Element-2">|z|=|z+i|</script></td><td><input name="plot" id="0" checked="" type="checkbox"></td><td><input class="btn btn-block" name="del" id="del0" value="X" type="button"></td></tr><tr id="row1"><td><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-3-Frame" tabindex="0" style="position: relative;" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle displaystyle="true"><mrow><mo>|</mo><mi>z</mi><mo>|</mo></mrow><mo>=</mo><mrow><mo>|</mo><mi>z</mi><mo>-</mo><mn>1</mn><mo>|</mo></mrow></mstyle></math>" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-201" style="width: 6.372em; display: inline-block;"><span style="display: inline-block; position: relative; width: 5.298em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.691em, 1005.17em, 2.927em, -1000em); top: -2.56em; left: 0em;"><span class="mrow" id="MathJax-Span-202"><span class="mstyle" id="MathJax-Span-203"><span class="mrow" id="MathJax-Span-204"><span class="mrow" id="MathJax-Span-205"><span class="mo" id="MathJax-Span-206" style="font-family: STIXVariants;">|</span><span class="mi" id="MathJax-Span-207" style="font-family: STIXGeneral; font-style: italic;">z</span><span class="mo" id="MathJax-Span-208" style="font-family: STIXVariants;">|</span></span><span class="mo" id="MathJax-Span-209" style="font-family: STIXGeneral; padding-left: 0.375em; padding-right: 0.375em;">=</span><span class="mrow" id="MathJax-Span-210"><span class="mo" id="MathJax-Span-211" style="font-family: STIXVariants;">|</span><span class="mi" id="MathJax-Span-212" style="font-family: STIXGeneral; font-style: italic;">z</span><span class="mo" id="MathJax-Span-213" style="font-family: STIXGeneral; padding-left: 0.3em; padding-right: 0.3em;">−</span><span class="mn" id="MathJax-Span-214" style="font-family: STIXGeneral;">1</span><span class="mo" id="MathJax-Span-215" style="font-family: STIXVariants;">|</span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.56em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.298em; border-left: 0px solid; width: 0px; height: 1.198em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mstyle displaystyle="true"><mrow><mo>|</mo><mi>z</mi><mo>|</mo></mrow><mo>=</mo><mrow><mo>|</mo><mi>z</mi><mo>-</mo><mn>1</mn><mo>|</mo></mrow></mstyle></math></span></span><script type="math/asciimath" id="MathJax-Element-3">|z|=|z-1|</script></td><td><input name="plot" id="1" checked="" type="checkbox"></td><td><input class="btn btn-block" name="del" id="del1" value="X" type="button"></td></tr></tbody>',2,'2 Lines','','data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAPWklEQVR4nO3dXVBU9xnH8UN7k15wZ/ei5cIyGTJDpzR1hsy01Aw3DZ0YymQYrNU6MTB21L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9O3aLf9Nu2236bNhy7TOxsP0rQZObrx41/Opnc2HqSNBxtpx+mW0GtGj8r9F3Wvm/7yPFqx7ThtO3ZNmbtozW7D5aTNWqz896I1u2nX2XbD5cVi4DIvQ/F4mdfn8+keGzEbZjcCx3ry1+j/R6+trTVdRnFxcVz+JdgAwlA8AolVjx49ovr6empsbKTz58/T9evX4/rvzwIQhgBEbgDC0FQG4vP54voT4GkDEIamMpCp/HsjAhCWAERuAMIQgMgNQBgCELkBCEMAIjcAYQhA5AYgDAGI3ACEIQCRG4AwBCByAxCGAERuAMIQgMgNQBgCELkBCEMAIjcAYQhA5AYgDAGI3ACEIQCRG4AwBCByAxCGAERuAMIQgMgNQBgCELlpIxsY6+FwOMjhcMR8PaIxRv/bfAkJCVFbjnVvMS3Z864ybt1ux+/tKYYW6xX4f/hBA4jcgUMshnCIJTcAYQhA5AYgDAGI3ACEIQCRG4AwBCByAxCGAERuAMIQgMgNQBgCELkBCEMAIjcAYQhA5AYgDAGI3ACEIQCRG4AwBCByAxCGAERuAMIQgMgNQBgCELkBCEMAIjcAYQhA5AYgDAGI3ACEIQCRG4AwBCByAxCGAERuAMIQgMgNQBgCELkBCEMAIjcAYQhA5AYgDAGI3ACEIQCRG4AwBCByAxCGAERuAMIQgMgNQBgCELkBCEMAIjcAYQhA5AYgDAGI3ACEIQCRG4AwBCByAxCGAERuAMIQgMgNQBgCELkBCEMAIjcAYQhA5AYgDAGI3ACEIQCRG4AwBCByAxCGAERuAMIQgMgNQBgCELn9B4KLRTkmtn8TAAAAAElFTkSuQmCC')
db.session.add(graph1)
db.session.commit()
if __name__ == "__main__":
setup_database()