Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app
db_repository
.gitignore
README.md
config_generic.py
db_create.py
db_downgrade.py
db_migrate.py
db_upgrade.py
requirements.txt
run.py

README.md

baweb

Requirements

Python 3.x

Setup

$ git clone https://github.com/cederstrom/baweb.git
$ cd baweb
$ mkvirtualenv --python=/usr/bin/python3 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()
You can’t perform that action at this time.