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

All Samples(9)  |  Call(5)  |  Derive(0)  |  Import(4)

src/f/l/flamejam-HEAD/flamejam/models/game.py   flamejam(Download)
# -*- coding: utf-8 -*-
 
from flamejam import app, db
from flamejam.utils import get_slug, average, average_non_zero
from flamejam.models.gamescreenshot import GameScreenshot
    def __init__(self, team, title):
        self.team = team
        self.jam = team.jam
        self.title = title
        self.slug = get_slug(title)

src/f/l/flamejam-HEAD/flamejam/views/game.py   flamejam(Download)
from flamejam import app, db, mail
from flamejam.utils import get_slug
from flamejam.models import Jam, Game, User, Comment, GamePackage, \
    GameScreenshot, JamStatusCode, Rating
from flamejam.models.rating import RATING_CATEGORIES
 
    if form.validate_on_submit():
        slug = get_slug(form.title.data)
        # if not jam.games.filter_by(slug = slug).first() in (game, None):
            # flash("A game with a similar title already exists. Please choose another title.", category = "error")
                setattr(game, "score_" + c + "_enabled", form.get(c).data)
 
        game.slug = get_slug(game.title)
        db.session.commit()
        flash("Your settings have been applied.", category = "success")

src/f/l/flamejam-HEAD/flamejam/views/admin.py   flamejam(Download)
from flamejam import app, db, admin_permission, mail
from flamejam.utils import get_slug
from flamejam.models import User, Jam, Game
from flamejam.forms import JamDetailsForm, AdminWriteAnnouncement, AdminUserForm
from flask import render_template, redirect, url_for, request, flash
            form.populate_obj(jam)
            jam.title.strip()
            jam.slug = get_slug(jam.title)
            jam.theme.strip()
            jam.description.strip()

src/f/l/flamejam-HEAD/flamejam/models/jam.py   flamejam(Download)
# -*- coding: utf-8 -*-
 
from flamejam import app, db, mail
from flamejam.utils import get_slug
from flamejam.filters import formattime, humandelta
    def __init__(self, title, start_time, duration = 48, team_limit = 0, theme = ''):
        self.title = title
        self.slug = get_slug(title)
        self.start_time = start_time
        self.duration = duration