Commit 1d04f81e authored by Mindiell's avatar Mindiell

Corrected malformed main word quizz into real word quiz....

parent 5ac3022e
# BrainBrain quizz
# BrainBrain Quiz
BrainBrain quizz is a web application
BrainBrain Quiz is a web application
## Installation
Clone this repository
git clone --depth 1 https://framagit.org/brainbrain/bbquizz.git
git clone --depth 1 https://framagit.org/brainbrain/bbquiz.git
[TODO]
Install is something like all those commands....
cd bbquizz
cd bbquiz
virtualenv -p python3 ve
source ve/bin/activate
pip install -r requirements.txt
......
......@@ -45,7 +45,7 @@ class UserApi(Controller):
def old_answer(self, player_id, answer_id, timer=0):
player = PlayerModel.query.get(player_id)
score = 0
question = player.game.quizz.questions.all()[player.game.question-1]
question = player.game.quiz.questions.all()[player.game.question-1]
if int(question.answer)==int(answer_id):
# Computing score
score = int(((question.time_allowed-timer)/question.time_allowed)*100)*10
......@@ -62,7 +62,7 @@ class UserApi(Controller):
def answer(self, player_id):
player = PlayerModel.query.get(player_id)
question = player.game.quizz.questions.all()[player.game.question-1]
question = player.game.quiz.questions.all()[player.game.question-1]
answer = int(request.form['answer'])
time = int(request.form['time'])
score = 0
......
......@@ -3,11 +3,11 @@
from flask import render_template, g
from app.controller.controller import Controller
from app.model.quizz import Quizz as QuizzModel
from app.model.quiz import Quiz as QuizModel
class Core(Controller):
def home(self):
g.quizzes = QuizzModel.query.all()
g.quizes = QuizModel.query.all()
return render_template('core/home.html')
def about(self):
......
......@@ -5,20 +5,20 @@ import random
from app.controller.controller import Controller
from app.form.game import GamePlayForm
from app.model.quizz import Quizz as QuizzModel
from app.model.quiz import Quiz as QuizModel
from app.model.game import Game as GameModel
from app.model.player import Player as PlayerModel
from app.model.result import Result as ResultModel
class Game(Controller):
def create(self, quizz_id):
def create(self, quiz_id):
"""
Select one quizz to start a new game
Select one quiz to start a new game
"""
gin = "".join([str(random.randint(0,9)) for i in range(0,6)])
while GameModel.query.filter_by(gin=gin).count()>0:
gin = "".join([str(random.randint(0,9)) for i in range(0,6)])
g.game = GameModel(quizz_id=quizz_id, status="waiting")
g.game = GameModel(quiz_id=quiz_id, status="waiting")
g.game.gin = gin
g.game.save()
session["game_id"] = g.game.id
......@@ -30,7 +30,7 @@ class Game(Controller):
"""
g.game = GameModel.query.get(session["game_id"])
if g.game is None:
return redirect(url_for("quizz.list"))
return redirect(url_for("quiz.list"))
return render_template("game/waiting.html")
def start(self):
......@@ -39,7 +39,7 @@ class Game(Controller):
"""
g.game = GameModel.query.get(session["game_id"])
if g.game is None:
return redirect(url_for("quizz.list"))
return redirect(url_for("quiz.list"))
g.game.status = "starting"
g.game.gin = ""
g.game.save()
......@@ -51,20 +51,20 @@ class Game(Controller):
"""
g.game = GameModel.query.get(session["game_id"])
if g.game is None:
return redirect(url_for("quizz.list"))
if g.game.question + 1>len(g.game.quizz.questions.all()):
return redirect(url_for("quiz.list"))
if g.game.question + 1>len(g.game.quiz.questions.all()):
g.game.status = "resume"
g.game.save()
return redirect(url_for("game.resume"))
g.game.status = "started"
g.game.question = g.game.question + 1
g.game.save()
g.question = g.game.quizz.questions.all()[g.game.question-1]
g.question = g.game.quiz.questions.all()[g.game.question-1]
return render_template("game/question.html")
def resume(self):
g.game = GameModel.query.get(session["game_id"])
if g.game is None:
return redirect(url_for("quizz.list"))
return redirect(url_for("quiz.list"))
return render_template("game/resume.html")
......@@ -5,29 +5,29 @@ from flask_babel import gettext as _
import random
from app.controller.controller import Controller
from app.form.quizz import QuizzCreateForm, QuestionCreateForm
from app.model.quizz import Quizz as QuizzModel
from app.form.quiz import QuizCreateForm, QuestionCreateForm
from app.model.quiz import Quiz as QuizModel
from app.model.question import Question as QuestionModel
class Quizz(Controller):
class Quiz(Controller):
def create(self):
g.form = QuizzCreateForm()
g.form = QuizCreateForm()
if g.form.validate_on_submit():
quizz = QuizzModel(
quiz = QuizModel(
name = g.form.name.data
)
quizz.save()
session["quizz_id"] = quizz.id
flash(_("Quizz created"), "success")
return redirect(url_for("quizz.add_question"))
return render_template("quizz/create.html")
quiz.save()
session["quiz_id"] = quiz.id
flash(_("Quiz created"), "success")
return redirect(url_for("quiz.add_question"))
return render_template("quiz/create.html")
def add_question(self):
g.form = QuestionCreateForm()
g.quizz = QuizzModel.query.get(session["quizz_id"])
g.quiz = QuizModel.query.get(session["quiz_id"])
if g.form.validate_on_submit():
question = QuestionModel(
quizz_id = g.quizz.id,
quiz_id = g.quiz.id,
question = g.form.question.data,
answer_1 = g.form.answer_1.data,
answer_2 = g.form.answer_2.data,
......@@ -37,13 +37,13 @@ class Quizz(Controller):
)
question.save()
flash(_("Question created"), "success")
return redirect(url_for("quizz.add_question"))
return render_template("quizz/add_question.html")
return redirect(url_for("quiz.add_question"))
return render_template("quiz/add_question.html")
def list(self):
"""
List quizzes
List quizes
"""
g.quizzes = QuizzModel.query.all()
return render_template("quizz/list.html")
g.quizes = QuizModel.query.all()
return render_template("quiz/list.html")
......@@ -19,7 +19,7 @@ class User(Controller):
if user:
if user.is_active:
login_user(user)
return redirect(url_for("quizz.list"))
return redirect(url_for("quiz.list"))
else:
flash(_("Account not active"), "warning")
for (field, message) in g.form.errors.items():
......@@ -33,5 +33,5 @@ class User(Controller):
def parameters(self):
# TODO: Display and edit user's parameters
return redirect(url_for("quizz.list"))
return redirect(url_for("quiz.list"))
......@@ -5,7 +5,7 @@ from flask_babel import lazy_gettext as _
from wtforms import StringField, SelectField
from wtforms.validators import DataRequired
class QuizzCreateForm(FlaskForm):
class QuizCreateForm(FlaskForm):
name = StringField(_("Name"), validators=[DataRequired()])
class QuestionCreateForm(FlaskForm):
......
#encoding: utf-8
import app.model.user
import app.model.quizz
import app.model.quiz
import app.model.question
import app.model.game
import app.model.player
......
......@@ -5,8 +5,8 @@ from app.model.model import Model, View
class Game(db.Model, Model):
id = db.Column(db.Integer, primary_key=True)
quizz_id = db.Column(db.Integer, db.ForeignKey('quizz.id'))
quizz = db.relationship('Quizz', backref=db.backref('games', lazy='dynamic'))
quiz_id = db.Column(db.Integer, db.ForeignKey('quiz.id'))
quiz = db.relationship('Quiz', backref=db.backref('games', lazy='dynamic'))
gin = db.Column(db.String(6))
question = db.Column(db.Integer, default=0)
status = db.Column(db.String(30))
......
......@@ -5,8 +5,8 @@ from app.model.model import Model, View
class Question(db.Model, Model):
id = db.Column(db.Integer, primary_key=True)
quizz_id = db.Column(db.Integer, db.ForeignKey('quizz.id'))
quizz = db.relationship('Quizz', backref=db.backref('questions', lazy='dynamic'))
quiz_id = db.Column(db.Integer, db.ForeignKey('quiz.id'))
quiz = db.relationship('Quiz', backref=db.backref('questions', lazy='dynamic'))
question = db.Column(db.String(300))
answer_1 = db.Column(db.String(300))
answer_2 = db.Column(db.String(300))
......
......@@ -3,7 +3,7 @@
from app import admin, db
from app.model.model import Model, View
class Quizz(db.Model, Model):
class Quiz(db.Model, Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(300))
......@@ -11,4 +11,4 @@ class Quizz(db.Model, Model):
return "%s" % self.name
# Model will be automatically managed through flask-admin module
admin.add_view(View(Quizz, db.session))
admin.add_view(View(Quiz, db.session))
......@@ -3,7 +3,7 @@
from app.controller.admin import Admin
from app.controller.core import Core
from app.controller.user import User
from app.controller.quizz import Quizz
from app.controller.quiz import Quiz
from app.controller.game import Game
from app.controller.player import Player
from app.controller.api import UserApi, MasterApi
......@@ -16,11 +16,11 @@ routes = [
('/logout', User.as_view('logout')),
('/parameters', User.as_view('parameters')),
('/quizz', Quizz.as_view('list')),
('/quizz/new', Quizz.as_view('create'), ['GET', 'POST']),
('/quizz/question/new', Quizz.as_view('add_question'), ['GET', 'POST']),
('/quiz', Quiz.as_view('list')),
('/quiz/new', Quiz.as_view('create'), ['GET', 'POST']),
('/quiz/question/new', Quiz.as_view('add_question'), ['GET', 'POST']),
('/game/create/<quizz_id>', Game.as_view('create')),
('/game/create/<quiz_id>', Game.as_view('create')),
('/game/waiting', Game.as_view('waiting')),
('/game/start', Game.as_view('start')),
('/game/question', Game.as_view('question')),
......
{% extends 'base.html' %}
{% block content %}
<section class="about">
<p>{{ _("BrainBrain Quizz is a learning tool to use within a group. It's used to compete with fun as learners !") }}</p>
<p>{{ _("BrainBrain Quiz is a learning tool to use within a group. It's used to compete with fun as learners !") }}</p>
</section>
{% endblock %}
{% extends 'base.html' %}
{% block content %}
<section class="presentation">
<p>{{ _("BrainBrain Quizz is a learning tool to use within a group. It's used to compete with fun as learners !") }}</p>
<p>{{ _("BrainBrain Quiz is a learning tool to use within a group. It's used to compete with fun as learners !") }}</p>
</section>
<section class="quizz_list">
<section class="quiz_list">
<div class="filter">
<form method="POST" action="#">
<input class="text" type="text" placeholder="{{ _('Filter quizz') }}" onclick="" />
<input class="text" type="text" placeholder="{{ _('Filter quiz') }}" onclick="" />
<img class="button" src="static/img/filter.png" alt="Search" onclick="" />
</form>
</div>
{% for quizz in g.quizzes %}
<a class="quizz" href="{{ url_for('game.create', quizz_id=quizz.id) }}">
{% for quiz in g.quizes %}
<a class="quiz" href="{{ url_for('game.create', quiz_id=quiz.id) }}">
<span class="cover"><img src="static/img/help.png" /></span>
<span class="title">{{ quizz.name }}</span>
<span class="stats">{{ _("%s question(s)" % quizz.questions.count()) }} - {{ _("Used %s times" % 0) }}</span>
<span class="title">{{ quiz.name }}</span>
<span class="stats">{{ _("%s question(s)" % quiz.questions.count()) }} - {{ _("Used %s times" % 0) }}</span>
</a>
{% endfor %}
</section>
......
......@@ -3,9 +3,9 @@
{% block content %}
<section class="row">
<section class="col-12" id="step_1">
<h1>{{ g.game.quizz.name }}</h1>
<h1>{{ g.game.quiz.name }}</h1>
<h2>{{ _("Question") }} {{ g.game.question }}/{{ g.game.quizz.questions.count() }}</h2>
<h2>{{ _("Question") }} {{ g.game.question }}/{{ g.game.quiz.questions.count() }}</h2>
<p>{{ g.question.question }}</p>
<p><span id="chrono"></span></p>
......
......@@ -3,11 +3,11 @@
{% block content %}
<section class="row">
<section class="col-12">
<h1>{{ g.game.quizz.name }}</h1>
<h1>{{ g.game.quiz.name }}</h1>
<h2>{{ _("Starting") }}</h2>
{{ g.game.quizz.questions.count() }} {{ _("questions !") }}
{{ g.game.quiz.questions.count() }} {{ _("questions !") }}
<form id="start_form" method="get" action="{{ url_for('game.question') }}"></form>
</section>
</section>
......
......@@ -3,10 +3,10 @@
{% block content %}
<section class="row">
<section class="col-12">
<h1>{{ g.game.quizz.id }} - {{ g.game.quizz.name }}</h1>
<h1>{{ g.game.quiz.id }} - {{ g.game.quiz.name }}</h1>
<h2>{{ _("Waiting for participants") }}</h2>
{{ _("Quizz Identification Number :") }} {{ g.game.gin }}
{{ _("Quiz Identification Number :") }} {{ g.game.gin }}
<ul id="list_of_players">
</ul>
......
......@@ -8,7 +8,7 @@
<meta name="author" content="">
<meta name="description" content="">
<link rel="icon" href="/static/img/favicon.ico">
<title>BrainBrain Quizz - {{ config.VERSION }}</title>
<title>BrainBrain Quiz - {{ config.VERSION }}</title>
<!-- Website CSS -->
<link rel="stylesheet" href="/static/css/style.css" />
</head>
......
......@@ -8,16 +8,16 @@
<img class="burger icon" src="/static/img/burger.png" />
<nav class="burger_menu">
<ul>
<li><a href="{{ url_for('quizz.list') }}">{{ _("My quizz") }}</a></li>
<li><a href="{{ url_for('quizz.create') }}">{{ _("Create new quizz") }}</a></li>
<li><a href="{{ url_for('quiz.list') }}">{{ _("My quiz") }}</a></li>
<li><a href="{{ url_for('quiz.create') }}">{{ _("Create new quiz") }}</a></li>
<li><a href="{{ url_for('user.parameters') }}">{{ _("Parameters") }}</a></li>
<li><a href="{{ url_for('user.logout') }}">{{ _("Disconnect") }}</a></li>
</ul>
</nav>
<nav class="menu">
<ul>
<li><a href="{{ url_for('quizz.list') }}"><img src="/static/img/quizz_list.png" class="icon" title="{{ _("My quizz") }}" alt="{{ _("My quizz") }}" /></a></li>
<li><a href="{{ url_for('quizz.create') }}"><img src="/static/img/quizz_create.png" class="icon" title="{{ _("Create new quizz") }}" alt="{{ _("Create new quizz") }}" /></a></li>
<li><a href="{{ url_for('quiz.list') }}"><img src="/static/img/quiz_list.png" class="icon" title="{{ _("My quiz") }}" alt="{{ _("My quiz") }}" /></a></li>
<li><a href="{{ url_for('quiz.create') }}"><img src="/static/img/quiz_create.png" class="icon" title="{{ _("Create new quiz") }}" alt="{{ _("Create new quiz") }}" /></a></li>
<li><a href="{{ url_for('user.parameters') }}"><img src="/static/img/parameters.png" class="icon" title="{{ _("Parameters") }}" alt="{{ _("Parameters") }}" /></a></li>
<li><a href="{{ url_for('user.logout') }}"><img src="/static/img/logout.png" class="icon" title="{{ _("Disconnect") }}" alt="{{ _("Disconnect") }}" /></a></li>
</ul>
......
......@@ -3,7 +3,7 @@
{% block content %}
<section class="row">
<section class="col-12">
<h1>{{ g.player.game.quizz.name }}</h1>
<h1>{{ g.player.game.quiz.name }}</h1>
<p>{{ _("Waiting for game to start...") }}</p>
<p><span id="player_number">0</span> {{ _("players have joined") }}</p>
......
......@@ -3,10 +3,10 @@
{% block content %}
<section class="row">
<section class="col-12">
<h1>{{ g.quizz.id }} - {{ g.quizz.name }}</h1>
<h1>{{ g.quiz.id }} - {{ g.quiz.name }}</h1>
<h2>{{ _("Add question") }} {{ 1+g.quizz.questions.count() }}</h2>
<form method="post" action="{{ url_for('quizz.add_question') }}">
<h2>{{ _("Add question") }} {{ 1+g.quiz.questions.count() }}</h2>
<form method="post" action="{{ url_for('quiz.add_question') }}">
{{ g.form.hidden_tag() }}
{{ render_field(g.form.question) }}
{{ render_field(g.form.answer_1) }}
......
......@@ -3,9 +3,9 @@
{% block content %}
<section class="row">
<section class="col-12">
<h1>{{ _("Create new quizz") }}</h1>
<h1>{{ _("Create new quiz") }}</h1>
<form method="post" action="{{ url_for('quizz.create') }}">
<form method="post" action="{{ url_for('quiz.create') }}">
{{ g.form.hidden_tag() }}
{{ render_field(g.form.name) }}
<input type="submit" value="{{ _("Create") }}" />
......
{% extends 'base.html' %}
{% block content %}
<h1>{{ _("List of your quizz") }}</h1>
<section class="quizz_list">
<h1>{{ _("List of your quiz") }}</h1>
<section class="quiz_list">
<div class="filter">
<form method="POST" action="#">
<input class="text" type="text" placeholder="{{ _('Filter quizz') }}" onclick="" />
<input class="text" type="text" placeholder="{{ _('Filter quiz') }}" onclick="" />
<img class="button" src="static/img/filter.png" alt="Search" onclick="" />
</form>
</div>
{% for quizz in g.quizzes %}
<a class="quizz" href="">
{% for quiz in g.quizes %}
<a class="quiz" href="">
<span class="cover"><img src="static/img/help.png" /></span>
<span class="title">{{ quizz.name }}</span>
<span class="stats">{{ _("%s question(s)" % quizz.questions.count()) }} - {{ _("Used %s times" % 0) }}</span>
<span class="title">{{ quiz.name }}</span>
<span class="stats">{{ _("%s question(s)" % quiz.questions.count()) }} - {{ _("Used %s times" % 0) }}</span>
</a>
{% endfor %}
</section>
......
......@@ -18,7 +18,7 @@ JINJA_ENV = {
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
# defining database URI
SQLALCHEMY_DATABASE_URI = "mysql://root:root@localhost/quizz"
SQLALCHEMY_DATABASE_URI = "mysql://root:root@localhost/quiz"
SQLALCHEMY_TRACK_MODIFICATIONS = False
# defining Babel settings
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2019-01-30 21:12+0100\n"
"POT-Creation-Date: 2019-02-01 20:14+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......@@ -29,11 +29,11 @@ msgstr ""
msgid "This pseudo already exists, please choose another one"
msgstr ""
#: app/controller/quizz.py:21
msgid "Quizz created"
#: app/controller/quiz.py:21
msgid "Quiz created"
msgstr ""
#: app/controller/quizz.py:39
#: app/controller/quiz.py:39
msgid "Question created"
msgstr ""
......@@ -49,31 +49,31 @@ msgstr ""
msgid "Pseudo to use"
msgstr ""
#: app/form/quizz.py:9
#: app/form/quiz.py:9
msgid "Name"
msgstr ""
#: app/form/quizz.py:12 app/view/game/question.html:8
#: app/form/quiz.py:12 app/view/game/question.html:8
msgid "Question"
msgstr ""
#: app/form/quizz.py:13 app/form/quizz.py:18
#: app/form/quiz.py:13 app/form/quiz.py:18
msgid "Answer 1"
msgstr ""
#: app/form/quizz.py:14 app/form/quizz.py:19
#: app/form/quiz.py:14 app/form/quiz.py:19
msgid "Answer 2"
msgstr ""
#: app/form/quizz.py:15 app/form/quizz.py:20
#: app/form/quiz.py:15 app/form/quiz.py:20
msgid "Answer 3"
msgstr ""
#: app/form/quizz.py:16 app/form/quizz.py:21
#: app/form/quiz.py:16 app/form/quiz.py:21
msgid "Answer 4"
msgstr ""
#: app/form/quizz.py:17
#: app/form/quiz.py:17
msgid "Correct answer"
msgstr ""
......@@ -102,11 +102,11 @@ msgid "Play !"
msgstr ""
#: app/view/menu.html:11 app/view/menu.html:19
msgid "My quizz"
msgid "My quiz"
msgstr ""
#: app/view/menu.html:12 app/view/menu.html:20 app/view/quizz/create.html:6
msgid "Create new quizz"
#: app/view/menu.html:12 app/view/menu.html:20 app/view/quiz/create.html:6
msgid "Create new quiz"
msgstr ""
#: app/view/menu.html:13 app/view/menu.html:21
......@@ -123,12 +123,12 @@ msgstr ""
#: app/view/core/about.html:4 app/view/core/home.html:4
msgid ""
"BrainBrain Quizz is a learning tool to use within a group. It's used to "
"BrainBrain Quiz is a learning tool to use within a group. It's used to "
"compete with fun as learners !"
msgstr ""
#: app/view/core/home.html:9 app/view/quizz/list.html:7
msgid "Filter quizz"
#: app/view/core/home.html:9 app/view/quiz/list.html:7
msgid "Filter quiz"
msgstr ""
#: app/view/game/question.html:24
......@@ -180,7 +180,7 @@ msgid "Waiting for participants"
msgstr ""
#: app/view/game/waiting.html:9
msgid "Quizz Identification Number :"
msgid "Quiz Identification Number :"
msgstr ""
#: app/view/game/waiting.html:14
......@@ -223,15 +223,15 @@ msgstr ""
msgid "players have joined"
msgstr ""
#: app/view/quizz/add_question.html:8 app/view/quizz/add_question.html:17
#: app/view/quiz/add_question.html:8 app/view/quiz/add_question.html:17
msgid "Add question"
msgstr ""
#: app/view/quizz/create.html:11
#: app/view/quiz/create.html:11
msgid "Create"
msgstr ""
#: app/view/quizz/list.html:3
msgid "List of your quizz"
#: app/view/quiz/list.html:3
msgid "List of your quiz"
msgstr ""
"""empty message
Revision ID: 1711e4cf71a1
Revises: 2717157f3e25
Create Date: 2019-01-24 13:41:01.321110
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '1711e4cf71a1'
down_revision = '2717157f3e25'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('question', sa.Column('time_allowed', sa.Integer(), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('question', 'time_allowed')
# ### end Alembic commands ###
"""empty message
Revision ID: 2717157f3e25
Revises: c5b02ad8d6d1
Create Date: 2019-01-16 08:23:29.421258
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '2717157f3e25'
down_revision = 'c5b02ad8d6d1'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('game', sa.Column('question', sa.Integer(), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('game', 'question')
# ### end Alembic commands ###
"""empty message
Revision ID: 741225ea420b
Revises: fbdb6ffa3bc9
Create Date: 2019-01-11 22:02:52.367418
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '741225ea420b'
down_revision = 'fbdb6ffa3bc9'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('player', sa.Column('status', sa.String(length=30), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('player', 'status')
# ### end Alembic commands ###
"""empty message
Revision ID: 82cde07647c7
Revises:
Create Date: 2019-01-06 17:09:54.731084
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '82cde07647c7'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('quizz',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('name', sa.String(length=300), nullable=True),
sa.PrimaryKeyConstraint('id')
)
op.create_table('user',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('login', sa.String(length=1000), nullable=True),
sa.Column('password', sa.String(length=64), nullable=True),
sa.Column('email', sa.String(length=1000), nullable=True),
sa.Column('active', sa.Boolean(), nullable=True),
sa.Column('admin', sa.Boolean(), nullable=True),
sa.PrimaryKeyConstraint('id')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('user')
op.drop_table('quizz')
# ### end Alembic commands ###
"""empty message
Revision ID: b1e901153ce9
Revises: 82cde07647c7