personalizare
This commit is contained in:
6
app.py
6
app.py
@@ -33,10 +33,6 @@ class Content(db.Model):
|
||||
player_id = db.Column(db.Integer, db.ForeignKey('player.id'), nullable=True)
|
||||
group_id = db.Column(db.Integer, db.ForeignKey('group.id'), nullable=True)
|
||||
|
||||
@app.before_first_request
|
||||
def create_tables():
|
||||
db.create_all()
|
||||
|
||||
@app.route('/')
|
||||
def dashboard():
|
||||
players = Player.query.all()
|
||||
@@ -107,4 +103,6 @@ def player_page(player_id):
|
||||
return render_template('player_page.html', player=player, content=content)
|
||||
|
||||
if __name__ == '__main__':
|
||||
with app.app_context():
|
||||
db.create_all() # Creează toate tabelele
|
||||
app.run(debug=True)
|
||||
|
||||
BIN
instance/dashboard.db
Normal file
BIN
instance/dashboard.db
Normal file
Binary file not shown.
@@ -19,11 +19,12 @@
|
||||
|
||||
<h2>Groups</h2>
|
||||
<ul>
|
||||
{% for group_name, group in groups.items() %}
|
||||
{% for group in groups %}
|
||||
<li>
|
||||
{{ group_name }} ({{ group.players | length }} players)
|
||||
{{ group.name }} ({{ group.players | length }} players)
|
||||
</li>
|
||||
{% endfor %}
|
||||
|
||||
</ul>
|
||||
<a href="{{ url_for('add_group') }}">Add Group</a>
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
{% endfor %}
|
||||
</optgroup>
|
||||
<optgroup label="Groups">
|
||||
{% for group_name in groups.keys() %}
|
||||
<option value="{{ group_name }}">{{ group_name }}</option>
|
||||
{% for group in groups %}
|
||||
<option value="{{ group.id }}">{{ group.name }}</option>
|
||||
{% endfor %}
|
||||
</optgroup>
|
||||
</select><br>
|
||||
|
||||
Reference in New Issue
Block a user