commit 704ff03bb45ea93be2c9b130c1302f07c97cdaf2
parent c6f746d38760df623970d9d4e63897ed90838003
Author: Friedel Schön <[email protected]>
Date: Mon, 4 Apr 2022 14:19:07 +0200
merged friedel-dev
Diffstat:
2 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/templates/index.html b/flaskblog/templates/index.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 %}