~muirrum/comortas

6deb1944a94b82f5d2f88298338900c4fc178f99 — Cara Salter 3 years ago 1dcd924
Team edits
M fllscoring/models.py => fllscoring/models.py +3 -3
@@ 27,9 27,9 @@ class Tournaments(db.Model):
class Team(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    tournament = db.Column(db.Integer, ForeignKey("tournaments.id", ondelete="CASCADE", onupdate="CASCADE"), nullable=False, index=True)
    team_number = db.Column(db.Integer, nullable=False, unique=True)
    team_name = db.Column(db.String, nullable=False, default="No Name")
    team_town = db.Column(db.String, nullable=False, default="No Town")
    team_number = db.Column(db.Integer, nullable=False, unique=True, info={'label': 'Team Number'})
    team_name = db.Column(db.String, nullable=False, default="No Name", info={'label': 'Team Name'})
    team_town = db.Column(db.String, nullable=False, default="No Town", info={'label': 'Team Town'})

    def __str__(self):
        return f"{self.team_number} - {self.team_name}"

A fllscoring/templates/setup/edit_team.html => fllscoring/templates/setup/edit_team.html +14 -0
@@ 0,0 1,14 @@
{% extends 'base.html' %}

{% block content %}
<form method="POST">
    {{ form.csrf_token }}
    {% for field in form %}
        {{ field.label }}<br>{{ field(class_="paper") }}<br>
    {% endfor %}
    <span class="hbar">
        <input type="submit" class="paper movable accent" value="Submit">
        <a href="{{ url_for('setup.delete_team', team_id=team.id, tournament_id=team.tournament) }}" class="paper movable">Delete</a>
    </span>
</form>
{% endblock %}
\ No newline at end of file

M fllscoring/templates/setup/tournament_mgmt.html => fllscoring/templates/setup/tournament_mgmt.html +5 -3
@@ 13,8 13,10 @@
    <a class="paper movable accent" href="{{url_for('setup.new_team', tournament_id=tournament.id) }}">New</a>
</span>
{% for t in teams %}
<div class="paper">
    {{ t }}
</div>
<a href="{{ url_for('setup.edit_team', team_id=t.id, tournament_id=tournament.id) }}">
    <div class="paper">
        {{ t }}
    </div>
</a>
{% endfor %}
{% endblock %}
\ No newline at end of file

M requirements.txt => requirements.txt +9 -0
@@ 1,5 1,6 @@
alembic==1.5.8
click==7.1.2
decorator==5.0.7
dnspython==2.1.0
dominate==2.6.0
email-validator==1.1.2


@@ 11,17 12,25 @@ Flask-WTF==0.14.3
greenlet==1.0.0
idna==3.1
importlib-metadata==3.10.1
infinity==1.5
intervals==0.9.1
itsdangerous==1.1.0
Jinja2==2.11.3
Mako==1.1.4
MarkupSafe==1.1.1
pkg-resources==0.0.0
psycopg2==2.8.6
python-dateutil==2.8.1
python-editor==1.0.4
six==1.15.0
SQLAlchemy==1.4.7
SQLAlchemy-Utils==0.37.0
typing-extensions==3.7.4.3
validators==0.18.2
visitor==0.1.3
Werkzeug==1.0.1
WTForms==2.3.3
WTForms-Alchemy==0.17.0
WTForms-Components==0.10.5
WTForms-SQLAlchemy==0.2
zipp==3.4.1