Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(40)  |  Call(40)  |  Derive(0)  |  Import(0)

src/f/l/flamejam-HEAD/scripts/seed-db.py   flamejam(Download)
 
# Add users
db.session.add(peter)
db.session.add(paul)
db.session.add(per)
db.session.add(pablo)
db.session.add(paddy)

src/f/l/flamejam-HEAD/flamejam/views/game.py   flamejam(Download)
    if enabled and form.validate_on_submit():
        game = Game(r.team, form.title.data)
        db.session.add(game)
        db.session.commit()
        return redirect(url_for("edit_game", jam_slug = jam_slug, game_id = game.id))
    if package_form.validate_on_submit():
        s = GamePackage(game, package_form.url.data, package_form.type.data)
        db.session.add(s)
        db.session.commit()
        flash("Your package has been added.", "success")
        return redirect(request.url)
 
    if screenshot_form.validate_on_submit():
        s = GameScreenshot(screenshot_form.url.data, screenshot_form.caption.data, game)
        db.session.add(s)
    if current_user.is_authenticated() and comment_form.validate_on_submit():
        comment = Comment(comment_form.text.data, game, current_user)
        db.session.add(comment)
        db.session.commit()
 
        if not rating:
            rating = Rating(game, current_user, form.note.data, form.score.data)
            db.session.add(rating)
        else:
            rating.text = form.note.data

src/f/l/flamejam-HEAD/flamejam/models/user.py   flamejam(Download)
    def joinJam(self, jam, generateTeam = True):
        p = Participation(self, jam)
        db.session.add(p)
        db.session.commit() # need to commit so the team does not register us automatically
 
    def generateTeam(self, jam):
        t = Team(self, jam)
        db.session.add(t)
        db.session.commit()
 

src/f/l/flamejam-HEAD/flamejam/models/team.py   flamejam(Download)
        else:
            i = Invitation(self, user)
            db.session.add(i)
            db.session.commit()
            body = render_template("emails/invitation.txt", team=self, sender=sender, recipient=user, invitation=i)

src/f/l/flamejam-HEAD/flamejam/views/admin.py   flamejam(Download)
            if mode == "create":
                jam = Jam("", datetime.utcnow())
                db.session.add(jam)
 
            form.populate_obj(jam)

src/f/l/flamejam-HEAD/flamejam/views/account.py   flamejam(Download)
        mail.send_message(subject="Welcome to " + app.config["LONG_NAME"] + ", " + username, recipients=[new_user.email], body=body)
 
        db.session.add(new_user)
        db.session.commit()
 

src/f/l/flamejam-HEAD/scripts/init-db.py   flamejam(Download)
 
admin = User(username, password, email, is_admin = True, is_verified = True)
db.session.add(admin)
 
db.session.commit()