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

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

src/f/l/flamejam-HEAD/flamejam/views/game.py   flamejam(Download)
        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))
 
 
        game.slug = get_slug(game.title)
        db.session.commit()
        flash("Your settings have been applied.", category = "success")
        return redirect(game.url())
 
    if package_form.validate_on_submit():
        s = GamePackage(game, package_form.url.data, package_form.type.data)
        db.session.add(s)
        db.session.commit()
        s = GameScreenshot(screenshot_form.url.data, screenshot_form.caption.data, game)
        db.session.add(s)
        db.session.commit()
        flash("Your screenshot has been added.", "success")
        return redirect(request.url)
    if action == "delete":
        db.session.delete(p)
    db.session.commit()
    return redirect(url_for("edit_game", jam_slug = p.game.jam.slug, game_id = p.game.id))
 

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
 
        if generateTeam:
            self.generateTeam(jam)
        else:
            db.session.commit()
    def generateTeam(self, jam):
        t = Team(self, jam)
        db.session.add(t)
        db.session.commit()
 

src/f/l/flamejam-HEAD/flamejam/views/admin.py   flamejam(Download)
                user.email = user.new_email
 
    db.session.commit()
 
    flash(str(len(users)) + " users were changed", "success")
            game.has_cheated = not game.has_cheated
 
    db.session.commit()
 
    flash(str(len(games)) + " games were changed", "success")
            user.avatar = form.avatar.data
            user.email = form.email.data
            db.session.commit()
            flash("User changed successfully.", "success")
            return redirect(url_for("admin_user", username = user.username))
            jam.restrictions.strip()
 
            db.session.commit()
            flash("Jam settings have been saved.", "success")
            return redirect(url_for("admin_jam", id = jam.id))
        flash("Toggled deleted flag")
        game.is_deleted = not game.is_deleted
        db.session.commit()
    if flag == "cheated":
        flash("Toggled cheated flag")

src/f/l/flamejam-HEAD/flamejam/models/team.py   flamejam(Download)
 
        r.team = self
        db.session.commit()
 
    def userLeave(self, user):
 
        r.team = None
        db.session.commit()
 
    def destroy(self):
            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)
            mail.send_message(subject=app.config["LONG_NAME"] +": You have been invited to " + self.name, recipients=[user.email], body=body)

src/f/l/flamejam-HEAD/flamejam/models/invitation.py   flamejam(Download)
    def accept(self):
        self.team.userJoin(self.user)
        db.session.delete(self)
        db.session.commit()
 
    def decline(self):
        db.session.delete(self)
        db.session.commit()

src/f/l/flamejam-HEAD/scripts/seed-db.py   flamejam(Download)
 
# Commmit it all
db.session.commit()
 

src/f/l/flamejam-HEAD/flamejam/views/account.py   flamejam(Download)
 
        db.session.add(new_user)
        db.session.commit()
 
        flash("Your account has been created, confirm your email to verify.", "success")
        user = User.query.filter_by(username=form.username.data).first()
        user.token = randint(0, sys.maxint)
        db.session.commit()
 
        body = render_template("emails/account/reset_password.txt", recipient=user)
        # set the new password
        user.password = hash_password(form.password.data)
        db.session.commit()
        flash("Your password was updated and you can login with it now.", "success")
        return redirect(url_for('login'))
        user.is_verified = True
        user.email = user.new_email
        db.session.commit()
 
        flash("Your email has been confirmed, you may now login")
            flash("Your email address has changed. Please check your inbox for the verification.", "info")
 
        db.session.commit()
        flash("Your settings were saved.", "success")
 

src/f/l/flamejam-HEAD/flamejam/views/team.py   flamejam(Download)
        settings_form.populate_obj(team)
        team.livestreams.strip()
        db.session.commit()
        flash("The team settings were saved.", "success")
        return redirect(team.url())
        flash("You have revoked the invitation for %s." % invitation.user.username, "success")
        db.session.delete(invitation)
        db.session.commit()
        return redirect(url_for("team_settings", jam_slug = team.jam.slug))
    else:
        team.userLeave(user)
        user.generateTeam(jam)
        db.session.commit()
        flash("You left the team.", "success")
        return redirect(jam.url())

src/f/l/flamejam-HEAD/flamejam/views/misc.py   flamejam(Download)
                    db.session.delete(i)
 
    db.session.commit()
 
    return msg

src/f/l/flamejam-HEAD/scripts/init-db.py   flamejam(Download)
db.session.add(admin)
 
db.session.commit()
 

  1 | 2  Next