hanze/programmeerles-ouderen

a fresh start (0c77edaed576f13a3c0af07ae75d8af61a7102d6)
Repositories

commit 0c77edaed576f13a3c0af07ae75d8af61a7102d6
parent 16d772e9373cfe1b787a09fee9e6a0e7e34f73db
Author: xd <[email protected]>
Date:   Mon,  4 Apr 2022 14:01:36 +0200

a fresh start

Diffstat:
Mflaskblog/models.py6++++--
Mflaskblog/site.db0
Mflaskblog/templates/home.html3++-
3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/flaskblog/models.py b/flaskblog/models.py @@ -10,6 +10,7 @@ def load_user(user_id): class User(db.Model, UserMixin): id = db.Column(db.Integer, primary_key=True) + type = db.Column(db.string(6), nullable=False, default="client") username = db.Column(db.String(20), unique=True, nullable=False) email = db.Column(db.String(120), unique=True, nullable=False) image_file = db.Column(db.String(20), nullable=False, default='default.jpg') @@ -20,10 +21,11 @@ class User(db.Model, UserMixin): class Language(db.Model): id = db.Column(db.Integer, primary_key=True) - language = db.Column(db.String(100), nullable=False) + name = db.Column(db.String(100), nullable=False) + info = db.Column(db.Text) def __repr__(self): - return f"Language('{self.language}')" + return f"Language('{self.name}', '{self.info}')" class Classes(db.Model): id = db.Column(db.Integer, primary_key=True) diff --git a/flaskblog/site.db b/flaskblog/site.db Binary files differ. diff --git a/flaskblog/templates/home.html b/flaskblog/templates/home.html @@ -3,7 +3,8 @@ {% for name in languages %} <article class="media content-section"> <div class="media-body"> - <h1>{{name.language}}</h1> + <h1>{{languages.name}}</h1> + <p> {{languages.info}}</p> </div> </article> {% endfor %}