Skip to content

Latest commit

 

History

History
73 lines (53 loc) · 1.18 KB

README.md

File metadata and controls

73 lines (53 loc) · 1.18 KB

baweb

Requirements

Python 3.8

Setup

$ git clone https://github.com/cederstrom/baweb.git
$ cd baweb
$ mkvirtualenv --python=/usr/bin/python3.8 baweb
$ pip install -r requirements.txt
$ python db_create.py

Run

$ python run.py

Datebase cheatsheet

workon baweb-prod
cd baweb-prod
python

Flytta medlem mellan lag

from app.models import Team, TeamMember, User
from app import db

m = TeamMember.query.get(1)
Team.query.get(1).members.append(m)
Team.query.get(2).members.remove(m)

db.session.commit()

Ta bort medlem

from app.models import Team, TeamMember, User
from app import db

TeamMember.query.filter_by(id=1).delete()

db.session.commit()

Ta bort alla lag och medlemmar

from app.models import Team, TeamMember, User
from app import db

TeamMember.query.delete()
Team.query.delete()

db.session.commit()

Lägga till admin

from app.models import Team, TeamMember, User
from app import db

u = User(facebook_id=999999, nickname='nick name', email='name@example.com', is_admin=True, generation=99, favorite_sport='', best_dekk='')
db.session.add(u)

db.session.commit()