Beispiel #1
0
def admin_jam(id = 0):
    mode = "create"
    jam = None

    if id != 0:
        jam = Jam.query.filter_by(id = id).first_or_404()
        mode = "edit"

    form = JamDetailsForm(obj=jam)

    if form.validate_on_submit():
        slug_jam = Jam.query.filter_by(slug = get_slug(form.title.data.strip())).first()
        if slug_jam and slug_jam != jam:
            flash("A jam with a similar title already exists (slug conflict).", "error")
        else:
            if mode == "create":
                jam = Jam("", datetime.utcnow())
                db.session.add(jam)

            form.populate_obj(jam)
            jam.title.strip()
            jam.slug = get_slug(jam.title)
            jam.theme.strip()
            jam.description.strip()
            jam.restrictions.strip()

            db.session.commit()
            flash("Jam settings have been saved.", "success")
            return redirect(url_for("admin_jam", id = jam.id))

    return render_template("admin/jam.html", id = id, mode = mode, jam = jam, form = form)
Beispiel #2
0
                  "lpdla",
                  "*****@*****.**",
                  is_verified=True,
                  receive_emails=False)
pablo = Participant("pablo", "lad112", "*****@*****.**")
paddy = Participant("paddy", "rqtjio4j1", "*****@*****.**")

# Add users
db.session.add(peter)
db.session.add(paul)
db.session.add(per)
db.session.add(pablo)
db.session.add(paddy)

# Make jams
rgj1 = Jam("Reddit Game Jam 1", paul, datetime.utcnow() - timedelta(days=30))
rgj2 = Jam("Reddit Game Jam 2", pablo, datetime.utcnow() - timedelta(days=2))
rgj3 = Jam("Reddit Game Jam 3", peter, datetime.utcnow())
loljam = Jam("Loljam", paul, datetime.utcnow() - timedelta(days=3))
rgj4 = Jam("Reddit Game Jam 4", peter, datetime.utcnow() + timedelta(days=14))
rgj3.theme = "Zombies"

# Add jams
db.session.add(rgj1)
db.session.add(rgj2)
db.session.add(rgj3)
db.session.add(loljam)
db.session.add(rgj4)

# Make entries
best_game = Entry("best game", "Simply the best game", rgj1, peter)
Beispiel #3
0
db.session.add(paul)
db.session.add(per)
db.session.add(pablo)
db.session.add(paddy)

paul.setLocation("Hohenbalk")
paul.ability_programmer = True
paul.ability_gamedesigner = True
paul.ability_3dartist = True
paul.abilities_extra = u"C++, Löve/Lua, Python, Java, SVG, HTML5, JS, Blender"
per.setLocation("Thesdorfer Weg 20, Pinneberg")
pablo.setLocation("Hamburg")
paddy.setLocation("San Francisco")

# Make jams
rgj1 = Jam("BaconGameJam 01", datetime.utcnow() - timedelta(days=30))
rgj2 = Jam("BaconGameJam 2", datetime.utcnow() - timedelta(days=2))
rgj3 = Jam("BaconGameJam 3", datetime.utcnow())
loljam = Jam("Test Jam", datetime.utcnow() - timedelta(days=3))
rgj4 = Jam("BaconGameJam 4", datetime.utcnow() + timedelta(days=14))
rgj4.team_limit = 4

rgj1.theme = "Bacon"
rgj2.theme = "Zombies"
rgj3.theme = "Space"
loljam.theme = "Funny"
rgj4.theme = "HIDDEN, SHOULD NOT BE SHOWN"

# Add jams
db.session.add(rgj1)
db.session.add(rgj2)