Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
chaos_familien_duell_frontend
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mowoe
chaos_familien_duell_frontend
Commits
742cb39d
Commit
742cb39d
authored
6 years ago
by
mowoe
Browse files
Options
Downloads
Patches
Plain Diff
Initial commit
parent
90db796a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
main.py
+63
-0
63 additions, 0 deletions
main.py
with
63 additions
and
0 deletions
main.py
0 → 100644
+
63
−
0
View file @
742cb39d
from
flask
import
Flask
from
flask
import
render_template
import
random
from
flask
import
request
from
peewee
import
*
db
=
SqliteDatabase
(
'
cfd.db
'
)
class
Answer
(
Model
):
q1
=
CharField
()
q2
=
CharField
()
q3
=
CharField
()
q4
=
CharField
()
q5
=
CharField
()
q6
=
CharField
()
q7
=
CharField
()
q8
=
CharField
()
q9
=
CharField
()
q10
=
CharField
()
class
Meta
:
database
=
db
questions
=
[[
"
wie heisst du?
"
,
0
],
[
"
wo wohnst du?
"
,
1
],
[
"
brot?
"
,
2
],
[
"
was ist das beste hackaspace
"
,
3
],
[
"
lol
"
,
4
],
[
"
lel
"
,
5
],
[
"
lul
"
,
6
],
[
"
lal
"
,
7
],
[
"
loel
"
,
8
],
[
"
lil
"
,
9
]]
app
=
Flask
(
__name__
)
@app.route
(
"
/
"
)
def
start
():
return
render_template
(
"
index.html
"
,
questions
=
questions
)
@app.route
(
"
/submit
"
,
methods
=
[
"
POST
"
])
def
submit
():
answers
=
[]
for
x
in
range
(
len
(
questions
)):
answers
.
append
(
request
.
form
.
get
(
str
(
x
)))
print
(
questions
[
x
][
0
],
request
.
form
.
get
(
str
(
x
)))
entr
=
Answer
(
q1
=
answers
[
0
],
q2
=
answers
[
1
],
q3
=
answers
[
2
],
q4
=
answers
[
3
],
q5
=
answers
[
4
],
q6
=
answers
[
5
],
q7
=
answers
[
6
],
q8
=
answers
[
7
],
q9
=
answers
[
8
],
q10
=
answers
[
9
])
entr
.
save
()
return
"
danki
"
if
__name__
==
"
__main__
"
:
db
.
connect
()
db
.
create_tables
([
q1
,
q2
,
q3
,
q4
,
q5
,
q6
,
q7
,
q8
,
q9
,
10
])
app
.
run
()
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment